summaryrefslogtreecommitdiff
path: root/TODO
diff options
context:
space:
mode:
authortavis_rudd <tavis_rudd>2002-10-06 00:14:53 +0000
committertavis_rudd <tavis_rudd>2002-10-06 00:14:53 +0000
commit43c5d7d79fda514096d6efe93279b399cc7b6057 (patch)
tree1447d29ed75328904d19a6f824613928340d67f9 /TODO
parentffeae9fade6c61b38730bf3d6a6530c39be1080f (diff)
downloadpython-cheetah-43c5d7d79fda514096d6efe93279b399cc7b6057.tar.gz
update
Mike, note the new variable name lookup order 1) locals (compile time optimized) 2) searchList [{"#set global"}, ...user defined parts of the searchList..., the template object it'self'] 3) globals() 4) __builtin__
Diffstat (limited to 'TODO')
-rw-r--r--TODO30
1 files changed, 0 insertions, 30 deletions
diff --git a/TODO b/TODO
index 775d664..2c6ce0a 100644
--- a/TODO
+++ b/TODO
@@ -72,36 +72,6 @@ Rewrite the caching framework
file is updated. This would allow a data structure to be kept in
sync whenever its text configuration file is changed.
-
-
-local/global/builtin variable lookup
-==============================================================================
-Cheetah currently does not allow users to override Python's builtin functions.
-This provides safety because it prevents users from overriding e.g. $str and
-breaking Cheetah horribly. However, it also prevents users from using common
-placeholder names such as $file, $max, $property, etc.; often requiring
-convoluted circumlocutions to shadow a database field that's named one of
-those. Worse, the application developer (template maintainer) can't be sure
-the user's version of Python won't have a new builtin defined that will make
-the template fail.
-
-Related to this is the question of whether to use bare variable names for
-lookup of local/global/builtin variables. Currently at compile time, Cheetah
-looks for a local/global/builtin variable and, if found, generates a bare
-variable name. If it's not found, it generates a a NameMapper lookup instead.
-Lookup of bare variable names is much faster, but it complicates the
-implementation and may contribute to the can't-override-builtins problem.
-
-To get rid of bare variable names in compiled templates, we'd need to add
-the equivalent objects to the searchList:
- 1) locals()
- 2) "#set global" variables
- 3) ... [user-defined searchList] ...
- 4) self -- the compiled template object
- 4) globals() -- for imported objects
- 5) __builtins__
-The order these objects appear in the searchList may be subject to debate.
-
#entry $func($arg1, $arg2="default", $**kw)
===============================================================================
Make a wrapper function in the .py template module that builds a searchList