Message376924
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__. | |
| Date | User | Action | Args | | 2020-09-15 02:12:45 | ethan.furman | set | recipients: + ethan.furman, barry, eli.bendersky | | 2020-09-15 02:12:45 | ethan.furman | set | messageid: <1600135965.76.0.76515083772.issue41789@roundup.psfhosted.org> | | 2020-09-15 02:12:45 | ethan.furman | link | issue41789 messages | | 2020-09-15 02:12:45 | ethan.furman | create | | |