Commit cd0a1818 authored by Aurel's avatar Aurel

add builtins for Zope2 only

parent ea10d4a3
...@@ -75,12 +75,16 @@ def add_builtins(**kw): ...@@ -75,12 +75,16 @@ def add_builtins(**kw):
del safe_builtins['dict'] del safe_builtins['dict']
del safe_builtins['list'] del safe_builtins['list']
add_builtins(Ellipsis=Ellipsis, NotImplemented=NotImplemented, add_builtins(Ellipsis=Ellipsis, NotImplemented=NotImplemented,
dict=dict, list=list) #, set=set, frozenset=frozenset) dict=dict, list=list)
if "set" not in safe_builtins: # BBB
add_builtins(set=set, frozenset=frozenset, slice=slice)
add_builtins(bin=bin, classmethod=classmethod, format=format, object=object, add_builtins(bin=bin, classmethod=classmethod, format=format, object=object,
property=property, staticmethod=staticmethod, property=property, staticmethod=staticmethod,
super=super, type=type) # slice=slice, super=super, type=type)
def guarded_next(iterator, default=_marker): def guarded_next(iterator, default=_marker):
"""next(iterator[, default]) """next(iterator[, default])
...@@ -102,7 +106,8 @@ def guarded_next(iterator, default=_marker): ...@@ -102,7 +106,8 @@ def guarded_next(iterator, default=_marker):
if default is _marker: if default is _marker:
raise raise
return default return default
#add_builtins(next=guarded_next) if "next" not in safe_builtins: # BBB
add_builtins(next=guarded_next)
_safe_class_attribute_dict = {} _safe_class_attribute_dict = {}
import inspect import inspect
......
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