Menu

#6 "Overwriting" a parent slot doesn't flush cache

Volkswagens
open
7
2000-11-26
2000-11-26
No

Overwriting a parent slot (see sample below) doesn't flush the cache of slots brought down from the parent being overwritten:

p1 = proto\( \)
\# add some slots
p2 = proto\( \)
\# add some slots

c = proto\( \)
c.isa\_p = p1
\# call some slots from p1

At this point, slots from p1 are cached in c's __dict__. Now:

c.isa\_p = p2

The slots from p1 are still cached in c's __dict__, even though p1 is no longer a parent (at least via slot "isa_p").

Discussion


Log in to post a comment.

MongoDB Logo MongoDB