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

Class BytesExpr

mypy/nodes.py:2291–2314  ·  view source on GitHub ↗

Bytes literal

Source from the content-addressed store, hash-verified

2289
2290
2291class BytesExpr(Expression):
2292 """Bytes literal"""
2293
2294 __slots__ = ("value",)
2295
2296 __match_args__ = ("value",)
2297
2298 # Note: we deliberately do NOT use bytes here because it ends up
2299 # unnecessarily complicating a lot of the result logic. For example,
2300 # we'd have to worry about converting the bytes into a format we can
2301 # easily serialize/deserialize to and from JSON, would have to worry
2302 # about turning the bytes into a human-readable representation in
2303 # error messages...
2304 #
2305 # It's more convenient to just store the human-readable representation
2306 # from the very start.
2307 value: str
2308
2309 def __init__(self, value: str) -> None:
2310 super().__init__()
2311 self.value = value
2312
2313 def accept(self, visitor: ExpressionVisitor[T]) -> T:
2314 return visitor.visit_bytes_expr(self)
2315
2316
2317class FloatExpr(Expression):

Callers 3

visit_ConstantMethod · 0.90
visit_bytes_exprMethod · 0.90
read_expressionFunction · 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…