A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-January/051337.html below:

[Python-Dev] Getting rid of unbound methods: patch available

[Python-Dev] Getting rid of unbound methods: patch available [Python-Dev] Getting rid of unbound methods: patch availableGreg Ewing greg.ewing at canterbury.ac.nz
Fri Jan 28 23:27:13 CET 2005
Guido van Rossum wrote:
> Here's a patch that gets rid of unbound methods, as
> discussed here before. A function's __get__ method
> now returns the function unchanged when called without
> an instance, instead of returning an unbound method object.

I thought the main reason for existence of unbound
methods (for user-defined classes, at least) was so that
if you screw up a super call by forgetting to pass self,
or passing the wrong type of object, you get a more
helpful error message.

I remember a discussion about this some years ago, in
which you seemed to think the ability to produce this
message was important enough to justify the existence
of unbound methods, even though it meant you couldn't
easily have static methods (this was long before
staticmethod() was created).

Have you changed your mind about that?

Also, surely unbound methods will still have to exist
for C methods? Otherwise there will be nothing to ensure
that C code is getting the object type it expects for
self.

--
Greg



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