[New-bugs-announce] [issue45892] Improve REPL with the underscore separators for int/float

Alex report at bugs.python.org
Wed Nov 24 10:55:50 EST 2021


New submission from Alex <alexprengere at gmail.com>:

I often use to the Python REPL to perform some simple calculations (typically some combinatorial or probabilities computation).
I believe it would be a nice improvement if the number displayed in the REPL would be formatted as if f"{result:_}" was given (with the underscore separators). For example:

 >>> 36 ** 7
 78_364_164_096

As I understand things:
* the REPL always shows the __repr__
* updating the __repr__ for int/float is a no-no for backward compatibility reasons

If these assumptions are correct (please correct me if this is wrong), then I guess this cannot be implemented, unless I missed something?

----------
components: Interpreter Core
messages: 406934
nosy: alexprengere
priority: normal
severity: normal
status: open
title: Improve REPL with the underscore separators for int/float
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45892>
_______________________________________


More information about the New-bugs-announce mailing list