On Mon, 28 Jun 2021, 6:02 pm Ethan Furman, <et...@stoneleaf.us> wrote:

> I have spoken with Pablo (3.10 RM), and he agrees that a change to Enum
> str() in 3.10 and another in 3.11 is less than
> ideal, so this new thread is to collect comments about Enum and it's str()
> and repr() and whether the changes take
> effect in 3.10, 3.11, or both.
>
> TL;DR -- sorry, there isn't one.
>

I'll have a go at one:

* Enum str() continuing as "module.NAME", while format() omits the module
* Enum repr() changing back to the historical behaviour, unless you opt in
to the new behaviour with the global enum decorator: definite +1 here
* Making str() consistent with format() and the non-Enum base class for
IntEnum et al (it is already consistent for StrEnum) rather than displaying
the symbolic name

I know I said in the other thread that the last change was problematic, but
I think you have a strong argument that the current behaviour breaks the
"drop in replacement" promise of those concrete types.

So my vote would be to revert both the repr() and str() changes on IntEnum
(et al) for 3.10, and then switch to the new str() approach for those
classes in 3.11.

Cheers,
Nick.


>
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/5WHRHS3DKJF44DY5MSRUD7YCHDOC5B5L/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to