ruff/crates/ty_python_semantic
Brandt Bucher 91b7a570c2
[ty] Implement Python's floor division semantics for Literal ints (#18249)
Division works differently in Python than in Rust. If the result is
negative and there is a remainder, the division rounds down (instead of
towards zero). The remainder needs to be adjusted to compensate so that
`(lhs // rhs) * rhs + (lhs % rhs) == lhs`.

Fixes astral-sh/ty#481.
2025-05-22 10:42:29 -04:00
..
resources [ty] Implement Python's floor division semantics for Literal ints (#18249) 2025-05-22 10:42:29 -04:00
src [ty] Implement Python's floor division semantics for Literal ints (#18249) 2025-05-22 10:42:29 -04:00
tests Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
build.rs
Cargo.toml
mdtest.py
mdtest.py.lock