Skip to content

Commit b1e73de

Browse files
committed
Don't use tp.definition.arguments in pretty_callable
This is a partial revert of d180456. Resolves #11899
1 parent 4e047a3 commit b1e73de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mypy/messages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,9 +1948,9 @@ def [T <: int] f(self, x: int, y: T) -> None
19481948

19491949
# If we got a "special arg" (i.e: self, cls, etc...), prepend it to the arg list
19501950
if isinstance(tp.definition, FuncDef) and tp.definition.name is not None:
1951-
definition_args = [arg.variable.name for arg in tp.definition.arguments]
1951+
definition_args = tp.definition.arg_names
19521952
if definition_args and tp.arg_names != definition_args \
1953-
and len(definition_args) > 0 and definition_args[0]:
1953+
and len(definition_args) > 0:
19541954
if s:
19551955
s = ', ' + s
19561956
s = definition_args[0] + s

0 commit comments

Comments
 (0)