This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients anthony-flury, mark.dickinson, r.david.murray
Date 2016-08-30.19:46:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1472586412.41.0.467248789923.issue27901@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-08-30 19:46:52r.david.murraysetrecipients: + r.david.murray, mark.dickinson, anthony-flury
2016-08-30 19:46:52r.david.murraysetmessageid: <1472586412.41.0.467248789923.issue27901@psf.upfronthosting.co.za>
2016-08-30 19:46:52r.david.murraylinkissue27901 messages
2016-08-30 19:46:52r.david.murraycreate