]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-40066: Enum: modify `repr()` and `str()` (GH-22392)
authorEthan Furman <ethan@stoneleaf.us>
Wed, 31 Mar 2021 04:17:26 +0000 (21:17 -0700)
committerGitHub <noreply@github.com>
Wed, 31 Mar 2021 04:17:26 +0000 (21:17 -0700)
commitb775106d940e3d77c8af7967545bb9a5b7b162df
treea5146740d7fab61a70bf410e4f348a9525cb1fd4
parent51a85ddce8b336addcb61b96f04c9c5edef07296
bpo-40066: Enum: modify `repr()` and `str()` (GH-22392)

* Enum: streamline repr() and str(); improve docs

- repr() is now ``enum_class.member_name``
- stdlib global enums are ``module_name.member_name``
- str() is now ``member_name``
- add HOW-TO section for ``Enum``
- change main documentation to be an API reference
19 files changed:
Doc/howto/enum.rst [new file with mode: 0644]
Doc/howto/index.rst
Doc/library/enum.rst
Doc/library/http.rst
Doc/library/socket.rst
Doc/library/ssl.rst
Doc/whatsnew/3.10.rst
Lib/enum.py
Lib/inspect.py
Lib/plistlib.py
Lib/re.py
Lib/test/test_enum.py
Lib/test/test_pydoc.py
Lib/test/test_signal.py
Lib/test/test_socket.py
Lib/test/test_ssl.py
Lib/test/test_unicode.py
Misc/NEWS.d/next/Library/2020-09-23-21-58-34.bpo-40066.f1dr_5.rst [new file with mode: 0644]
Misc/NEWS.d/next/Library/2021-03-25-21-26-30.bpo-40066.7EBQ3_.rst [new file with mode: 0644]