Message151548
Thanks for noticing. The doc for ismethod() says:
“Return true if the object is a bound method written in Python.”
and the docstring agrees with that:
“Return true if the object is an instance method. [...]”
So the change isn't properly a regression when reading the docs. On the other hand, it's true that some code may rely on the previous behaviour, and the discrepancy between getmembers() and a manual test can be confusing.
By the way, Python 3 has ismethod() right:
>>> class B:
... def f(self): pass
...
>>> inspect.ismethod(B.f)
False
>>> inspect.ismethod(B().f)
True |
|
| Date |
User |
Action |
Args |
| 2012-01-18 16:29:59 | pitrou | set | recipients:
+ pitrou, gvanrossum, facundobatista, dmaurer, amaury.forgeotdarc, flub, eric.araujo, meador.inge, jotr, BreamoreBoy, python-dev, eric.snow, vpelletier |
| 2012-01-18 16:29:59 | pitrou | set | messageid: <[email protected]> |
| 2012-01-18 16:29:58 | pitrou | link | issue1785 messages |
| 2012-01-18 16:29:58 | pitrou | create | |
|