Commit 034f12d1 authored by Aurel's avatar Aurel Committed by Arnaud Fontaine

add builtins for Zope2 only

parent 4da6c0f8
...@@ -76,12 +76,16 @@ def add_builtins(**kw): ...@@ -76,12 +76,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])
...@@ -103,7 +107,8 @@ def guarded_next(iterator, default=_marker): ...@@ -103,7 +107,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