summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/enum.py5
-rw-r--r--Misc/NEWS.d/next/Library/2023-09-23-12-47-45.gh-issue-109653.9wZBfs.rst1
2 files changed, 3 insertions, 3 deletions
diff --git a/Lib/enum.py b/Lib/enum.py
index 994a7b9..f5448a1 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -1,8 +1,6 @@
import sys
import builtins as bltns
from types import MappingProxyType, DynamicClassAttribute
-from operator import or_ as _or_
-from functools import reduce
__all__ = [
@@ -1884,7 +1882,8 @@ class verify:
missed = [v for v in values if v not in member_values]
if missed:
missing_names.append(name)
- missing_value |= reduce(_or_, missed)
+ for val in missed:
+ missing_value |= val
if missing_names:
if len(missing_names) == 1:
alias = 'alias %s is missing' % missing_names[0]
diff --git a/Misc/NEWS.d/next/Library/2023-09-23-12-47-45.gh-issue-109653.9wZBfs.rst b/Misc/NEWS.d/next/Library/2023-09-23-12-47-45.gh-issue-109653.9wZBfs.rst
new file mode 100644
index 0000000..1d0f0e4
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2023-09-23-12-47-45.gh-issue-109653.9wZBfs.rst
@@ -0,0 +1 @@
+Reduce the import time of :mod:`enum` by over 50%. Patch by Alex Waygood.