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

Class StrExpr

mypy/nodes.py:2265–2284  ·  view source on GitHub ↗

String literal

Source from the content-addressed store, hash-verified

2263
2264
2265class 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
2287def is_StrExpr_list(seq: list[Expression]) -> TypeGuard[list[StrExpr]]: # noqa: N802

Callers 12

check_typeddict_callMethod · 0.90
visit_ConstantMethod · 0.90
visit_JoinedStrMethod · 0.90
visit_FormattedValueMethod · 0.90
translate_dict_callMethod · 0.90
visit_str_exprMethod · 0.90
read_expressionFunction · 0.90
build_fstring_joinFunction · 0.90
read_fstring_itemFunction · 0.90
translate_fstringFunction · 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…