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



_______________________________________________
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