Skip to content
Merged
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
8 changes: 4 additions & 4 deletions mypy/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4059,11 +4059,11 @@ def get_method(self, name: str) -> FuncBase | Decorator | None:
for cls in self.mro:
sym = cls.names.get(name)
if sym is None:
# add_redefinition installs the unnumbered name before any numbered ones.
prefix = f"{name}-redefinition"
if prefix not in cls.names:
# Plugins are allowed to meddle with redefinitions (first one wins).
if cls.metadata:
sym = cls.names.get(f"{name}-redefinition")
if sym is None:
continue
sym = cls.names[max(n for n in cls.names if n.startswith(prefix))]
node = sym.node
if isinstance(node, SYMBOL_FUNCBASE_TYPES):
return node
Expand Down
Loading