class dict of subtyped types

C:\>python Python 2.2b1+ (#25, Oct 19 2001, 14:30:05) [MSC 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.
Other dict attributes are missing as well in the dict-proxy. Is this intentional? Thomas

The dict-proxy type is intended to provide a read-only proxy, so the dict-proxy is consciously lacking the update, clear, popitem and setdefault methods. It also seems to be missing the comparison operations; that's an oversight. --Guido van Rossum (home page: http://www.python.org/~guido/)

Yes, but you have to use the attribute notation: INT.foo = ... this is trapped so that certain magic happens automatically when you set attributes that override operators, e.g. INT.__add__ = lambda ... --Guido van Rossum (home page: http://www.python.org/~guido/)

The dict-proxy type is intended to provide a read-only proxy, so the dict-proxy is consciously lacking the update, clear, popitem and setdefault methods. It also seems to be missing the comparison operations; that's an oversight. --Guido van Rossum (home page: http://www.python.org/~guido/)

Yes, but you have to use the attribute notation: INT.foo = ... this is trapped so that certain magic happens automatically when you set attributes that override operators, e.g. INT.__add__ = lambda ... --Guido van Rossum (home page: http://www.python.org/~guido/)
participants (2)
-
Guido van Rossum
-
Thomas Heller