[issue41816] need StrEnum in enum.py

2020-09-22 Thread Ethan Furman
Ethan Furman added the comment: Thank you for your help, Serhiy! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue41816] need StrEnum in enum.py

2020-09-22 Thread Ethan Furman
Ethan Furman added the comment: New changeset d986d1657e1e7b50807d0633cb31d96a2d866d42 by Ethan Furman in branch 'master': bpo-41816: `StrEnum.__str__` is `str.__str__` (GH-22362) https://github.com/python/cpython/commit/d986d1657e1e7b50807d0633cb31d96a2d866d42 -- _

[issue41816] need StrEnum in enum.py

2020-09-22 Thread Ethan Furman
Change by Ethan Furman : -- pull_requests: +21400 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/22362 ___ Python tracker ___ _

[issue41816] need StrEnum in enum.py

2020-09-22 Thread Ethan Furman
Ethan Furman added the comment: >From Serhiy Storchaka: - The only exception is StrEnum -- overriding __str__ of str subclass may be not safe. Some code will call str() implicitly, other will read the string content of the object directly, and they will be different. --

[issue41816] need StrEnum in enum.py

2020-09-21 Thread Ethan Furman
Change by Ethan Furman : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue41816] need StrEnum in enum.py

2020-09-21 Thread Ethan Furman
Ethan Furman added the comment: New changeset 0063ff4e583505e69473caa978e476ea4c559b83 by Ethan Furman in branch 'master': bpo-41816: add `StrEnum` (GH-22337) https://github.com/python/cpython/commit/0063ff4e583505e69473caa978e476ea4c559b83 -- __

[issue41816] need StrEnum in enum.py

2020-09-21 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch pull_requests: +21382 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/22337 ___ Python tracker

[issue41816] need StrEnum in enum.py

2020-09-19 Thread Ethan Furman
New submission from Ethan Furman : Due to the nature of `str`, if an Enum tries to mixin the str type, all of it's members will be strings -- even if they didn't start out that way: class MyStrEnum(str, Enum): tuple = 'oops', okay = 'correct' >>> list(MyStrEnum) [, MyStrEnum.o