MCPcopy Index your code
hub / github.com/python/mypy / CallableArgument

Class CallableArgument

mypy/types.py:1149–1180  ·  view source on GitHub ↗

Represents a Arg(type, 'name') inside a Callable's type list. Note that this is a synthetic type for helping parse ASTs, not a real type.

Source from the content-addressed store, hash-verified

1147
1148
1149class CallableArgument(ProperType):
1150 """Represents a Arg(type, 'name') inside a Callable's type list.
1151
1152 Note that this is a synthetic type for helping parse ASTs, not a real type.
1153 """
1154
1155 __slots__ = ("typ", "name", "constructor")
1156
1157 typ: Type
1158 name: str | None
1159 constructor: str | None
1160
1161 def __init__(
1162 self,
1163 typ: Type,
1164 name: str | None,
1165 constructor: str | None,
1166 line: int = -1,
1167 column: int = -1,
1168 ) -> None:
1169 super().__init__(line, column)
1170 self.typ = typ
1171 self.name = name
1172 self.constructor = constructor
1173
1174 def accept(self, visitor: TypeVisitor[T]) -> T:
1175 assert isinstance(visitor, SyntheticTypeVisitor)
1176 ret: T = visitor.visit_callable_argument(self)
1177 return ret
1178
1179 def serialize(self) -> JsonDict:
1180 assert False, "Synthetic types don't serialize"
1181
1182
1183class TypeList(ProperType):

Callers 3

visit_CallMethod · 0.90
read_call_typeFunction · 0.90
expr_to_unanalyzed_typeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…