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.
| 1147 | |
| 1148 | |
| 1149 | class 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 | |
| 1183 | class TypeList(ProperType): |
no outgoing calls
no test coverage detected
searching dependent graphs…