Commit 5f726a27 authored by Stefan Behnel's avatar Stefan Behnel

extend list of builtins usable in compile time expressions

parent ccd3ee5a
...@@ -96,11 +96,15 @@ def initial_compile_time_env(): ...@@ -96,11 +96,15 @@ def initial_compile_time_env():
import __builtin__ as builtins import __builtin__ as builtins
except ImportError: except ImportError:
import builtins import builtins
names = ('False', 'True', names = ('False', 'True',
'abs', 'bool', 'chr', 'cmp', 'complex', 'dict', 'divmod', 'enumerate', 'abs', 'all', 'any', 'ascii', 'bin', 'bool', 'bytearray', 'bytes',
'float', 'hash', 'hex', 'int', 'len', 'list', 'long', 'map', 'max', 'min', 'chr', 'cmp', 'complex', 'dict', 'divmod', 'enumerate', 'filter',
'oct', 'ord', 'pow', 'range', 'reduce', 'repr', 'round', 'slice', 'str', 'float', 'format', 'frozenset', 'hash', 'hex', 'int', 'len',
'sum', 'tuple', 'xrange', 'zip') 'list', 'long', 'map', 'max', 'min', 'oct', 'ord', 'pow', 'range',
'repr', 'reversed', 'round', 'set', 'slice', 'sorted', 'str',
'sum', 'tuple', 'xrange', 'zip')
for name in names: for name in names:
try: try:
benv.declare(name, getattr(builtins, name)) benv.declare(name, getattr(builtins, name))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment