Back out last second change in the examples. `missing' should be an
empty mutable (i.e. list) since empty tuples are shared. Thanks Just!
This commit is contained in:
parent
e9ae8a5694
commit
9599e69426
10
pep-0231.txt
10
pep-0231.txt
|
@ -202,7 +202,7 @@ Examples
|
|||
if name.startswith('_'):
|
||||
return getattr(self.__contained, name)
|
||||
# Everything else gets wrapped
|
||||
missing = ()
|
||||
missing = []
|
||||
which = self.__contained
|
||||
obj = getattr(which, name, missing)
|
||||
if obj is missing:
|
||||
|
@ -257,7 +257,7 @@ Examples
|
|||
|
||||
def aq_acquire(self, name):
|
||||
# Everything else gets wrapped
|
||||
missing = ()
|
||||
missing = []
|
||||
which = self.__contained
|
||||
obj = getattr(which, name, missing)
|
||||
if obj is missing:
|
||||
|
@ -282,7 +282,7 @@ Examples
|
|||
if args:
|
||||
return setattr(self, name, args[0])
|
||||
obj = getattr(self, name)
|
||||
missing = ()
|
||||
missing = []
|
||||
of = getattr(obj, '__of__', missing)
|
||||
if of is not missing:
|
||||
return of(self)
|
||||
|
@ -410,7 +410,7 @@ Examples
|
|||
class Access:
|
||||
def __findattr__(self, name, *args):
|
||||
methcache = self.__dict__.setdefault('__cache__', {})
|
||||
missing = ()
|
||||
missing = []
|
||||
obj = getattr(self, name, missing)
|
||||
# if obj is missing we better be doing a setattr for
|
||||
# the first time
|
||||
|
@ -542,7 +542,7 @@ Examples
|
|||
else:
|
||||
op = 'get'
|
||||
# XXX: op = 'del' currently not supported
|
||||
missing = ()
|
||||
missing = []
|
||||
meth = getattr(self, hookname, missing)
|
||||
if meth is missing:
|
||||
if op == 'set':
|
||||
|
|
Loading…
Reference in New Issue