Bytes literal
| 2289 | |
| 2290 | |
| 2291 | class 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 | |
| 2317 | class FloatExpr(Expression): |
no outgoing calls
no test coverage detected
searching dependent graphs…