Visitar URL original
`#[newtype_oparg]` derive macro by ShaharNaveh · Pull Request #7489 · RustPython/RustPython · GitHub
Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Don't match on 255
  • Loading branch information
ShaharNaveh committed Mar 24, 2026
commit 796b61c955701a55f9a6f8ad2b85d0ce6d462def
3 changes: 1 addition & 2 deletions crates/vm/src/stdlib/_ast/other.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ impl Node for ast::ConversionFlag {
object: PyObjectRef,
) -> PyResult<Self> {
// Python's AST uses ASCII codes: 's', 'r', 'a', -1=None
// Note: 255 is -1i8 as u8 (ruff's ConversionFlag::None)
match i32::try_from_object(vm, object)? {
-1 | 255 => Ok(Self::None),
-1 => Ok(Self::None),
x if x == b's' as i32 => Ok(Self::Str),
x if x == b'r' as i32 => Ok(Self::Repr),
x if x == b'a' as i32 => Ok(Self::Ascii),
Expand Down
Loading