Comments (4)
Kajiki isn't supposed to implement everything that Genshi had. Kajiki is glad to drop a few of the misfeatures, especially those that made Genshi slow.
Now this feature here can be very convenient for the programmer, but the implementation would certainly cost something. I am not sure what is more valuable here.
I don't have the answer, I am just commenting like, don't expect Kajiki to be a clone of Genshi.
from kajiki.
don't expect Kajiki to be a clone of Genshi.
I certainly don't, but re: cost, well, even Jinja (which is universally considered a fast templating engine) supports this, so I thought this is the feature that's worth porting.
In [5]: from jinja2 import Template
In [8]: Template('{{ foo.bar }}').render(foo=foo)
Out[8]: 'baz'
from kajiki.
Uhm, I'm vaguely against this proposal for the reason that Kajiki maps your code to pure python code, which I like as it guarantees me that the code I wrote will be the resulting code. Providing this would mean injecting a call in every attribute access (which apart slowing down things) would break the guarantee that we don't inject additional behaviours in user code.
from kajiki.
I don't like this feature neither, getitem and getattr are two separate things in python
In [1]: spam = dict(egg='Spam')
In [2]: spam['egg']
Out[2]: 'Spam'
In [3]: spam.egg
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-3-1f641a831589> in <module>()
----> 1 spam.egg
AttributeError: 'dict' object has no attribute 'egg'
In [4]: pippo = type('Pippo', (object, ), dict(pluto='topolino'))()
In [5]: pippo.pluto
Out[5]: 'topolino'
In [6]: pippo['pluto']
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-6-dc79750a7340> in <module>()
----> 1 pippo['pluto']
TypeError: 'Pippo' object is not subscriptable
You may be intrested in https://stackoverflow.com/a/23689767 anyway. It's not about kajiki
from kajiki.
Related Issues (20)
- Python 3.8 support HOT 3
- Many HTML entities don't work HOT 5
- Python2 support using nine HOT 8
- py:if and "lower than" comparison
- XML comments outside root node cause py:else to raise XMLTemplateCompileError
- XML template with declaration <?xml version="1.0"?> becomes invalid due to internal Kajiki manipulation
- Python 3.10 compatibility error HOT 4
- travis-ci.org shutting down HOT 2
- migrate to pytest? HOT 1
- drop support for Python 2.6, 2.7, 3.0-3.3? HOT 4
- Kajiki needs a new owner? HOT 12
- 0.9.0: pytest is failing HOT 10
- kajiki fails to build with Python 3.11
- kajiki IDE suppprt HOT 2
- simple extends examples HOT 5
- XMLTemplate not working HOT 3
- Unit tests are failing on Python 3.11 HOT 2
- There is no code.co_endlinetable and code.co_columntable in python3.11 HOT 2
- kajiki 0.9.2 requires python-3.11 according to linetable dependency HOT 4
- API use of pkg_resources is deprecated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kajiki.