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 pitrou
Recipients BreamoreBoy, amaury.forgeotdarc, dmaurer, eric.araujo, eric.snow, facundobatista, flub, gvanrossum, jotr, meador.inge, pitrou, python-dev, vpelletier
Date 2012-01-18.16:29:58
SpamBayes Score 2.4486867e-06
Marked as misclassified No
Message-id <1326904199.49.0.396418860061.issue1785@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2012-01-18 16:29:59pitrousetrecipients: + pitrou, gvanrossum, facundobatista, dmaurer, amaury.forgeotdarc, flub, eric.araujo, meador.inge, jotr, BreamoreBoy, python-dev, eric.snow, vpelletier
2012-01-18 16:29:59pitrousetmessageid: <1326904199.49.0.396418860061.issue1785@psf.upfronthosting.co.za>
2012-01-18 16:29:58pitroulinkissue1785 messages
2012-01-18 16:29:58pitroucreate