mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-14 07:38:47 +00:00
Added bytes type and some inference (#13061)
## Summary This PR adds the `bytes` type to red-knot: - Added the `bytes` type - Added support for bytes literals - Support for the `+` operator Improves on #12701 Big TODO on supporting and normalizing r-prefixed bytestrings (`rb"hello\n"`) ## Test Plan Added a test for a bytes literals, concatenation, and corner values
This commit is contained in:
parent
2edd32aa31
commit
b9c8113a8a
6 changed files with 73 additions and 6 deletions
|
@ -2152,7 +2152,7 @@ impl BytesLiteralValue {
|
|||
}
|
||||
|
||||
/// Returns an iterator over the bytes of the concatenated bytes.
|
||||
fn bytes(&self) -> impl Iterator<Item = u8> + '_ {
|
||||
pub fn bytes(&self) -> impl Iterator<Item = u8> + '_ {
|
||||
self.iter().flat_map(|part| part.as_slice().iter().copied())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue