[issue41789] Enum: __str__ and friends sometimes erroneously replaced

2020-09-16 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



[issue41789] Enum: __str__ and friends sometimes erroneously replaced

2020-09-16 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset a4677068dd61662f5a56b184d5e3aa07db65b88e by Ethan Furman in 
branch '3.9':
[3.9] bpo-41789: honor object overrides in Enum classes (GH-22250) (GH-22272)
https://github.com/python/cpython/commit/a4677068dd61662f5a56b184d5e3aa07db65b88e


--

___
Python tracker 

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



[issue41789] Enum: __str__ and friends sometimes erroneously replaced

2020-09-15 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +21327
pull_request: https://github.com/python/cpython/pull/22272

___
Python tracker 

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



[issue41789] Enum: __str__ and friends sometimes erroneously replaced

2020-09-15 Thread miss-islington


miss-islington  added the comment:


New changeset 929112ef81ccef20d3aef25c8a1142059ee941da by Miss Islington (bot) 
in branch '3.8':
bpo-41789: honor object overrides in Enum classes (GH-22250)
https://github.com/python/cpython/commit/929112ef81ccef20d3aef25c8a1142059ee941da


--

___
Python tracker 

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



[issue41789] Enum: __str__ and friends sometimes erroneously replaced

2020-09-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21323
pull_request: https://github.com/python/cpython/pull/22267

___
Python tracker 

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



[issue41789] Enum: __str__ and friends sometimes erroneously replaced

2020-09-15 Thread miss-islington


miss-islington  added the comment:


New changeset 22415ad62555d79bd583b4a7d6a96006624a8277 by Ethan Furman in 
branch 'master':
bpo-41789: honor object overrides in Enum classes (GH-22250)
https://github.com/python/cpython/commit/22415ad62555d79bd583b4a7d6a96006624a8277


--
nosy: +miss-islington

___
Python tracker 

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



[issue41789] Enum: __str__ and friends sometimes erroneously replaced

2020-09-14 Thread Ethan Furman


Change by Ethan Furman :


--
keywords: +patch
pull_requests: +21306
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/22250

___
Python tracker 

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



[issue41789] Enum: __str__ and friends sometimes erroneously replaced

2020-09-14 Thread Ethan Furman


New submission from Ethan Furman :

If an Enum declares __str__, __repr__, __format__, or __reduce_ex__ to be 
object`s, then it will get replaced by the base Enum's corresponding method.  
E.g.:

  class RegexFlag(IntFlag):

 IGNORECASE = I = 2

 def repr(self):
 return 're.%s' % self.name

 __str__ = object.__str__

The intent of the above is have str(RegexFlag.I) == repr(RegexFlag.I) (with 
some quotes, of course), but currently RegexFlag.__str__ will be replaced with 
Flag.__str__.

--
assignee: ethan.furman
components: Library (Lib)
messages: 376924
nosy: barry, eli.bendersky, ethan.furman
priority: normal
severity: normal
stage: needs patch
status: open
title: Enum: __str__ and friends sometimes erroneously replaced
type: behavior
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

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