cpython icon indicating copy to clipboard operation
cpython copied to clipboard

Python 3.13.0b1 REPL does not deduplicate history entries

Open hroncok opened this issue 1 year ago • 2 comments

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 1 after the second press. I consider this the natural behavior.
  • On Python 3.13, I get 1 only after the 7nd press. I consider this weird.

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs

  • gh-119276

hroncok avatar May 14 '24 13:05 hroncok

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.

terryjreedy avatar May 14 '24 23:05 terryjreedy

The single-character example here is just an illustration, this happens with longer lines as well.

hroncok avatar May 15 '24 00:05 hroncok