String literal
| 2263 | |
| 2264 | |
| 2265 | class StrExpr(Expression): |
| 2266 | """String literal""" |
| 2267 | |
| 2268 | __slots__ = ("value", "as_type") |
| 2269 | |
| 2270 | __match_args__ = ("value",) |
| 2271 | |
| 2272 | value: str # '' by default |
| 2273 | # If this value expression can also be parsed as a valid type expression, |
| 2274 | # represents the type denoted by the type expression. |
| 2275 | # None means "is not a type expression". |
| 2276 | as_type: NotParsed | mypy.types.Type | None |
| 2277 | |
| 2278 | def __init__(self, value: str) -> None: |
| 2279 | super().__init__() |
| 2280 | self.value = value |
| 2281 | self.as_type = NotParsed.VALUE |
| 2282 | |
| 2283 | def accept(self, visitor: ExpressionVisitor[T]) -> T: |
| 2284 | return visitor.visit_str_expr(self) |
| 2285 | |
| 2286 | |
| 2287 | def is_StrExpr_list(seq: list[Expression]) -> TypeGuard[list[StrExpr]]: # noqa: N802 |
no outgoing calls
no test coverage detected
searching dependent graphs…