Add types and docstring to function _method_is_bound().

This commit is contained in:
Christian Walch 2022-03-31 14:33:48 +02:00
parent e8aae67c8a
commit 249ff9323c

View File

@ -129,7 +129,8 @@ class MockFinder(MetaPathFinder):
sys.modules.pop(modname, None)
def _method_is_bound(method):
def _method_is_bound(method: MethodType) -> bool:
"""Check if the method is a bound method."""
try:
return method.__self__ is not None
except AttributeError: