summaryrefslogtreecommitdiff
path: root/Lib/enum.py
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2016-04-13 23:55:40 -0700
committerEthan Furman <ethan@stoneleaf.us>2016-04-13 23:55:40 -0700
commit81a0b43d940db237de53e3290ac67a272cca385f (patch)
tree681bf77a09a989ff83a0fa95426e0d8233e9b641 /Lib/enum.py
parent100061c29e4582fc3d40bcc35986366ef41667bf (diff)
parent5c655b38b844fb6e540c6db65d505d63c89fde74 (diff)
downloadcpython-81a0b43d940db237de53e3290ac67a272cca385f.tar.gz
Issue26748: Enum classes should evaluate as True
Diffstat (limited to 'Lib/enum.py')
-rw-r--r--Lib/enum.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/enum.py b/Lib/enum.py
index 246df17b94..476e3b31ba 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -1,8 +1,14 @@
import sys
-from collections import OrderedDict
from types import MappingProxyType, DynamicClassAttribute
-__all__ = ['Enum', 'IntEnum', 'unique']
+# try _collections first to reduce startup cost
+try:
+ from _collections import OrderedDict
+except ImportError:
+ from collections import OrderedDict
+
+
+__all__ = ['EnumMeta', 'Enum', 'IntEnum', 'unique']
def _is_descriptor(obj):