Skip to content

Commit f49a785

Browse files
committed
fix
1 parent 50e47b5 commit f49a785

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mypy/suggestions.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,11 +416,12 @@ def get_guesses_from_parent(self, node: FuncDef) -> List[CallableType]:
416416
for parent in node.info.mro[1:]:
417417
pnode = parent.names.get(node.name)
418418
if pnode and isinstance(pnode.node, (FuncDef, Decorator)):
419-
typ = pnode.node.type
419+
typ = get_proper_type(pnode.node.type)
420+
# FIXME: Doesn't work right with generic tyeps
420421
if isinstance(typ, CallableType) and len(typ.arg_types) == len(node.arguments):
421422
# Return the first thing we find, since it probably doesn't make sense
422423
# to grab things further up in the chain if an earlier parent has it.
423-
return [pnode.node.type]
424+
return [typ]
424425

425426
return []
426427

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy