From 5f726a27461ee40040355e14b63166d87d657f36 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Wed, 13 Feb 2013 19:11:36 +0100 Subject: [PATCH] extend list of builtins usable in compile time expressions --- Cython/Compiler/Scanning.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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)) -- 2.7.4