Message273960
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. |
|
Date |
User |
Action |
Args |
2016-08-30 19:46:52 | r.david.murray | set | recipients:
+ r.david.murray, mark.dickinson, anthony-flury |
2016-08-30 19:46:52 | r.david.murray | set | messageid: <1472586412.41.0.467248789923.issue27901@psf.upfronthosting.co.za> |
2016-08-30 19:46:52 | r.david.murray | link | issue27901 messages |
2016-08-30 19:46:52 | r.david.murray | create | |
|