mirror of https://github.com/python/cpython
gh-109653: Improve `enum` import time by avoiding import of `functools` (GH-109789)
This commit is contained in:
parent
e8be0c9c5a
commit
51863b7d6e
|
@ -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]
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Reduce the import time of :mod:`enum` by over 50%. Patch by Alex Waygood.
|
Loading…
Reference in New Issue