Skip to content

Conversation

@plammens
Copy link

The behaviour of inspect.ismethod is inconsistent between Python 3 and 2. In Python 3, it returns True only for bound methods (since there's no way to tell whether a function object is an unbound method), while in Python 2 it returns True for both bound and unbound.

This PR adds an is_bound_method utility which returns True iff the object is callable and is a bound method (either instance- or class-).

Also added tests for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant