Commit Graph
3 Commits
Author SHA1 Message Date
Yubin KimandJeong, YunWon 7bd61d17d8 Rebase range iterator __reduce__ to match CPython (#8424)
* Rebase range iterator __reduce__ to match CPython

range_iterator.__reduce__ (and longrange_iterator) returned the original
range plus the current index as pickle state; CPython returns the range
rebased to the current position with a None state. Rebase start by
index * step (clamped to the length) and emit None. __setstate__ is kept
so pickles carrying an integer state still load.

Assisted-by: Claude Code:claude-opus-4-8

* Add snippet test for range iterator __reduce__

Assert the rebased range and None state added in the previous commit. The
snippet runner executes it under both CPython and RustPython, so it also
cross-checks the representation against CPython.

Assisted-by: Claude Code:claude-opus-4-8

* Update extra_tests/snippets/builtin_range.py

---------

Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
2026-08-21 17:16:40 +09:00
Rex Ledesma 4e2e0b41c6 chore: add ruff format --check (#5774)
* chore: add `ruff format --check`

* fix tests
2025-05-12 14:20:01 +09:00
Jeong YunWon e62a164f4d Move tests -> extra_tests 2020-09-13 06:58:57 +09:00