T
Talin
I want to make a dictionary that acts like a class, in other words,
supports inheritance: If you attempt to find a key that isn't present,
it searches a "base" dictionary, which in turn searches its base, and so on.
Now, I realize its fairly trivial to code something like this using
UserDict, but given that classes and modules already have this behavior,
is there some built-in type that already does this?
(This is for doing nested symbol tables and such.)
---
Also, on a completely different subject: Has there been much discussion
about extending the use of the 'is' keyword to do type comparisons a la
C# (e.g. "if x is list:") ?
-- Talin
supports inheritance: If you attempt to find a key that isn't present,
it searches a "base" dictionary, which in turn searches its base, and so on.
Now, I realize its fairly trivial to code something like this using
UserDict, but given that classes and modules already have this behavior,
is there some built-in type that already does this?
(This is for doing nested symbol tables and such.)
---
Also, on a completely different subject: Has there been much discussion
about extending the use of the 'is' keyword to do type comparisons a la
C# (e.g. "if x is list:") ?
-- Talin