On Nov 21, 2007 4:25 PM, Steven Bethard <[EMAIL PROTECTED]> 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/)
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to