Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions mypy/stubtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1534,8 +1534,15 @@ def is_probably_private(name: str) -> bool:

def is_probably_a_function(runtime: Any) -> bool:
return (
isinstance(runtime, (types.FunctionType, types.BuiltinFunctionType))
or isinstance(runtime, (types.MethodType, types.BuiltinMethodType))
isinstance(
runtime,
(
types.FunctionType,
types.BuiltinFunctionType,
types.MethodType,
types.BuiltinMethodType,
),
)
or (inspect.ismethoddescriptor(runtime) and callable(runtime))
or (isinstance(runtime, types.MethodWrapperType) and callable(runtime))
)
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ select = [
"PGH004", # blanket noqa comments
"UP", # pyupgrade
"C4", # flake8-comprehensions
"SIM101", # merge duplicate isinstance calls
"SIM201", "SIM202", "SIM222", "SIM223", # flake8-simplify
"FURB188", # use str.remove(pre|suf)fix
"ISC001", # implicitly concatenated string
Expand Down