You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there is some weird behavior regarding identifiers named after builtins. I notived it when using a Mako template written for an application running on Python 2.4 with Python 2.5 which introduced "all" as builtin. The template used that as identifier and after the upgrade to 2.5 the template broke.
Turns out that currently SQLAlchemy doesn't pull identifiers named after builtins from the context. This appears to be expected behavior as there is a unittest for that which apparently doesn't fail or at least not in that situation.
Currently the template "${id}" generates this code:
While the lookup of the builtin will be slowed down a bit the actual usage of it is faster because it's a local variable then which isn't looked up in a dict.
However that patch causes the current test for the old behavior to break. If the old behavior is really the desired one that should be documented at least.
The text was updated successfully, but these errors were encountered:
Migrated issue, originally created by Anonymous
Currently there is some weird behavior regarding identifiers named after builtins. I notived it when using a Mako template written for an application running on Python 2.4 with Python 2.5 which introduced "all" as builtin. The template used that as identifier and after the upgrade to 2.5 the template broke.
Turns out that currently SQLAlchemy doesn't pull identifiers named after builtins from the context. This appears to be expected behavior as there is a unittest for that which apparently doesn't fail or at least not in that situation.
Currently the template "${id}" generates this code:
I suggest generating this code instead:
While the lookup of the builtin will be slowed down a bit the actual usage of it is faster because it's a local variable then which isn't looked up in a dict.
I have a possible patch here: http://paste.pocoo.org/show/52822/
However that patch causes the current test for the old behavior to break. If the old behavior is really the desired one that should be documented at least.
The text was updated successfully, but these errors were encountered: