cpython
cpython copied to clipboard
Python 3.13.0b1 REPL does not deduplicate history entries
Bug report
Bug description:
Consider this:
>>> 1
1
>>> 2
2
>>> 2
2
>>> 2
2
>>> 2
2
>>> 2
2
>>> 2
2
>>>
Now press the arrow up (↑). 2 appears. Then, press it again...
- On Python 3.12, I get
1after the second ↑ press. I consider this the natural behavior. - On Python 3.13, I get
1only after the 7nd ↑ press. I consider this weird.
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
- gh-119276
I just discovered that IDLE's history mechanism, which I have not touched, deduplicates history, and/but? omits single char numbers. I would guess the latter is because retyping a single char is as easy as recalling it.
The single-character example here is just an illustration, this happens with longer lines as well.