diff options
author | Ethan Furman <ethan@stoneleaf.us> | 2023-04-18 23:19:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-18 23:19:23 (GMT) |
commit | 700ec657c80e78fb299963ffaa684c859ddb8f87 (patch) | |
tree | 61a25f3c6ed737451201814626b8af53e23db6ba /Python/dynamic_annotations.c | |
parent | 07804ce24c3103ee1bb141af31b9a1a0f92f5e43 (diff) | |
download | cpython-700ec657c80e78fb299963ffaa684c859ddb8f87.zip cpython-700ec657c80e78fb299963ffaa684c859ddb8f87.tar.gz cpython-700ec657c80e78fb299963ffaa684c859ddb8f87.tar.bz2 |
gh-103596: [Enum] do not shadow mixed-in methods/attributes (GH-103600)
For example:
class Book(StrEnum):
title = auto()
author = auto()
desc = auto()
Book.author.desc is Book.desc
but
Book.author.title() == 'Author'
is commonly expected. Using upper-case member names avoids this confusion and possible performance impacts.
Co-authored-by: samypr100 <3933065+samypr100@users.noreply.github.com>
Diffstat (limited to 'Python/dynamic_annotations.c')
0 files changed, 0 insertions, 0 deletions