From: Stefan Behnel Date: Wed, 13 Feb 2013 18:11:36 +0000 (+0100) Subject: extend list of builtins usable in compile time expressions X-Git-Tag: 0.19b1~184 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5f726a27461ee40040355e14b63166d87d657f36;p=platform%2Fupstream%2Fpython-cython.git extend list of builtins usable in compile time expressions --- diff --git a/Cython/Compiler/Scanning.py b/Cython/Compiler/Scanning.py index 8ba5e4d..8ba17c8 100644 --- a/Cython/Compiler/Scanning.py +++ b/Cython/Compiler/Scanning.py @@ -96,11 +96,15 @@ def initial_compile_time_env(): import __builtin__ as builtins except ImportError: import builtins + names = ('False', 'True', - 'abs', 'bool', 'chr', 'cmp', 'complex', 'dict', 'divmod', 'enumerate', - 'float', 'hash', 'hex', 'int', 'len', 'list', 'long', 'map', 'max', 'min', - 'oct', 'ord', 'pow', 'range', 'reduce', 'repr', 'round', 'slice', 'str', - 'sum', 'tuple', 'xrange', 'zip') + 'abs', 'all', 'any', 'ascii', 'bin', 'bool', 'bytearray', 'bytes', + 'chr', 'cmp', 'complex', 'dict', 'divmod', 'enumerate', 'filter', + 'float', 'format', 'frozenset', 'hash', 'hex', 'int', 'len', + 'list', 'long', 'map', 'max', 'min', 'oct', 'ord', 'pow', 'range', + 'repr', 'reversed', 'round', 'set', 'slice', 'sorted', 'str', + 'sum', 'tuple', 'xrange', 'zip') + for name in names: try: benv.declare(name, getattr(builtins, name))