ruff/crates/red_knot_python_semantic/resources/mdtest/subscript/bytes.md
Alex d77480768d
[red-knot] Port type inference tests to new test framework (#13719)
## Summary

Porting infer tests to new markdown tests framework.

Link to the corresponding issue: #13696

---------

Co-authored-by: Carl Meyer <carl@astral.sh>
2024-10-15 11:23:46 -07:00

299 B

Bytes subscript

Simple

w = b'red' b'knot'
x = b'hello'
y = b'world' + b'!'
z = b'\xff\x00'

reveal_type(w)  # revealed: Literal[b"redknot"]
reveal_type(x)  # revealed: Literal[b"hello"]
reveal_type(y)  # revealed: Literal[b"world!"]
reveal_type(z)  # revealed: Literal[b"\xff\x00"]