cpython/Doc/howto
Miss Islington (bot) 8c3793a539
[3.12] gh-108682: [Enum] raise TypeError if super().__new__ called in custom __new__ (GH-108704) (#108733)
gh-108682: [Enum] raise TypeError if super().__new__ called in custom __new__ (GH-108704)

When overriding the `__new__` method of an enum, the underlying data type should be created directly; i.e. .

    member = object.__new__(cls)
    member = int.__new__(cls, value)
    member = str.__new__(cls, value)

Calling `super().__new__()` finds the lookup version of `Enum.__new__`, and will now raise an exception when detected.
(cherry picked from commit d48760b2f1)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2023-09-01 00:04:55 +02:00
..
annotations.rst [3.12] gh-107432 Fix incorrect indentation in annotations HOWTO (GH-107445) (#107654) 2023-08-05 14:08:04 +02:00
argparse.rst [3.12] gh-54738: Add argparse i18n howto (GH-104562) (#107102) 2023-07-23 11:36:10 +02:00
clinic.rst [3.12] Docs: Argument Clinic: Move the CConverter class to the reference (GH-107671) (#107701) 2023-08-07 12:03:07 +02:00
cporting.rst gh-91838: Use HTTPS links in docs for resources which redirect to HTTPS (GH-95527) 2022-08-04 10:13:49 +03:00
curses.rst [3.12] gh-101100: Sphinx warnings: pick the low hanging fruits (GH-107386) (GH-107419) 2023-07-29 09:16:27 +03:00
descriptor.rst [3.12] gh-107298: Fix yet more Sphinx warnings in the C API doc (GH-107345) (GH-107380) 2023-07-28 08:20:53 +00:00
enum.rst [3.12] gh-108682: [Enum] raise TypeError if super().__new__ called in custom __new__ (GH-108704) (#108733) 2023-09-01 00:04:55 +02:00
functional.rst [3.12] gh-101100: Fix some broken sphinx references (GH-107095) (#107103) 2023-07-23 12:00:31 +02:00
index.rst gh-96143: Allow Linux perf profiler to see Python calls (GH-96123) 2022-08-30 10:11:18 -07:00
instrumentation.rst [3.12] gh-106948: Docs: Disable links for C standard library functions, OS utility functions and system calls (GH-107062) (#107154) 2023-07-23 23:13:23 +02:00
ipaddress.rst bpo-44740: Make minor edits to lowercasing "internet" and "web". (GH-27385) 2021-07-27 10:57:52 +02:00
isolating-extensions.rst [3.12] docs: fix grammar in isolating-extensions.rst (GH-108037) (#108218) 2023-08-21 21:40:08 +02:00
logging-cookbook.rst [3.12] gh-101100: Fix Sphinx warnings in the Logging Cookbook (GH-108678) (#108680) 2023-08-30 15:21:58 +02:00
logging.rst gh-103960: Dark mode: invert image brightness (#103983) 2023-05-10 16:46:37 +03:00
logging_flow.png Optimize images by IMGbot (GH-21348) 2022-02-04 15:49:43 +09:00
perf_profiling.rst gh-103295: expose API for writing perf map files (#103546) 2023-05-21 11:12:24 +01:00
pyporting.rst [3.12] gh-107432 Update Porting Python 2 Code to Python 3 how-to (GH-107434) (#108409) 2023-08-24 12:30:57 +02:00
regex.rst [3.12] gh-101100: Fix some broken sphinx references (GH-107095) (#107103) 2023-07-23 12:00:31 +02:00
sockets.rst Doc: Update references and examples of old, unsupported OSes and uarches (GH-92791) 2022-06-09 15:55:06 +02:00
sorting.rst [3.12] gh-101100: Fix some broken sphinx references (GH-107095) (#107103) 2023-07-23 12:00:31 +02:00
unicode.rst [3.12] gh-101100: Fix some broken sphinx references (GH-107095) (#107103) 2023-07-23 12:00:31 +02:00
urllib2.rst [3.12] howto/urllib2: remove link to an outdated french translation (GH-104193) (#104758) 2023-05-23 08:57:52 +00:00