Fix a typo, unfortunately propagated by word-completion.

This commit is contained in:
Tim Peters 2002-02-11 07:14:05 +00:00
parent 805ab456a8
commit d313d180ae
1 changed files with 12 additions and 12 deletions

View File

@ -261,7 +261,7 @@ Additional Ideas
class cell(object):
def __init__(self, obj=NULL, builtin=0):
self.objptr = obj
self.buitinflag = builtin
self.builtinflag = builtin
and a celldict maps strings to this version of cells. builtinflag
is true when and only when objptr contains a value obtained from
@ -305,26 +305,26 @@ Additional Ideas
if key in self.basedict:
c.objptr = self.basedict[key]
assert c.objptr is not NULL # else "in" lied
c.buitinflag = 1
c.builtinflag = 1
else:
# There is no builtin with the same name.
assert not c.buitinflag
assert not c.builtinflag
def keys(self):
return [k for k, c in self.__dict.iteritems()
if c.objptr is not NULL and not c.buitinflag]
if c.objptr is not NULL and not c.builtinflag]
def items(self):
return [k, c.objptr for k, c in self.__dict.iteritems()
if c.objptr is not NULL and not c.buitinflag]
if c.objptr is not NULL and not c.builtinflag]
def values(self):
preturn [c.objptr for c in self.__dict.itervalues()
if c.objptr is not NULL and not c.buitinflag]
if c.objptr is not NULL and not c.builtinflag]
def clear(self):
for c in self.__dict.values():
if not c.buitinflag:
if not c.builtinflag:
c.objptr = NULL
# Etc.
@ -357,14 +357,14 @@ Additional Ideas
def reflect_bltin_del(self, key):
c = self.__dict.get(key)
assert c is not None # else we were already out of synch
if c.buitinflag:
if c.builtinflag:
# Put us back in synch.
c.objptr = NULL
c.buitinflag = 0
c.builtinflag = 0
# Else we're shadowing the builtin, so don't care that
# the builtin went away.
Note that c.buitinflag protects from us erroneously deleting a
Note that c.builtinflag protects from us erroneously deleting a
module global of the same name. Adding a new (key, value) builtin
pair is similar:
@ -378,10 +378,10 @@ Additional Ideas
# but doesn't anymore; rehabilitate it.
assert not c.builtinflag
c.objptr = value
c.buitinflag = 1
c.builtinflag = 1
else:
# We're shadowing it already.
assert not c.buitinflag
assert not c.builtinflag
Changing the value of an existing builtin can be viewed as deleting
the name, then adding it again. Indeed, since mutating builtins is