mirror of
https://github.com/astral-sh/ruff
synced 2026-01-09 15:44:22 -05: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:
@@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user