On Nov 21, 2007 4:25 PM, Steven Bethard <steven.bethard at gmail.com> wrote: > Though I'd like to know what happens when I do something like:: > > >>> class C(object): > ... def __setitem__(self, key, value): > ... print key, value > ... > >>> c = C() > >>> dict.update(c, foo='bar') > Traceback (most recent call last): > File "<interactive input>", line 1, in <module> > TypeError: descriptor 'update' requires a 'dict' object but received a 'C' > > I assume the code will fail (though it would be really cool if it > didn't). How will it fail? I expect it won't change -- built-in types use a different mechanism. -- --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4