R. David Murray added the comment:

They are both correct.  In 2.7 a class method is a method.  In python3, a class 
method is a function.

As for the docs, the python3 docs say that it returns true for "a bound method 
on an object", while the python2 docs say "a bound or unbound method".  A class 
method is not bound, and unbound method do not exist in python3.  So the docs 
are correct as well.  The notes about the difference could go into a porting 
guide, but I don't think they belong in the main docs.

To fix your code, just treat function objects on classes as what you are 
thinking of as methods.  Because they are: any function assigned to a class 
becomes a bound method when invoked through an instance.  I think that's even 
backward compatible, though I haven't checked.

----------
nosy: +r.david.murray
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27901>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to