From 9599e69426ed96ac86f057b81adfda38eec17f35 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Sat, 2 Dec 2000 15:12:35 +0000 Subject: [PATCH] Back out last second change in the examples. `missing' should be an empty mutable (i.e. list) since empty tuples are shared. Thanks Just! --- pep-0231.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pep-0231.txt b/pep-0231.txt index 99ecdf5bd..88dbeded6 100644 --- a/pep-0231.txt +++ b/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':