[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.

--
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.okay: 'correct'>]

The StrEnum class will have a check to ensure that each value was already a 
string, or can be converted to a string via

  str(bytes, encoding, errors)

--
assignee: ethan.furman
components: Library (Lib)
messages: 377186
nosy: barry, eli.bendersky, ethan.furman, serhiy.storchaka, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: need StrEnum in enum.py
type: enhancement
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com