A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2007-November/075293.html below:

[Python-Dev] [python] Should we do away with unbound methods in Py3k?

[Python-Dev] [python] Should we do away with unbound methods in Py3k? [Python-Dev] [python] Should we do away with unbound methods in Py3k?Guido van Rossum guido at python.org
Thu Nov 22 04:16:27 CET 2007
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/)
More information about the Python-Dev mailing list

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