summaryrefslogtreecommitdiffstats
path: root/Lib/enum.py
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2016-09-04 18:39:01 (GMT)
committerEthan Furman <ethan@stoneleaf.us>2016-09-04 18:39:01 (GMT)
commit27682d2698cefb9edabffd14290123f439a84790 (patch)
tree18ad8bf4f94d4417bd2b3eaf4fbd27e0b89cb231 /Lib/enum.py
parentbce9cbaf98fa92718a4dfb7011f93aca3993b4d4 (diff)
downloadcpython-27682d2698cefb9edabffd14290123f439a84790.zip
cpython-27682d2698cefb9edabffd14290123f439a84790.tar.gz
cpython-27682d2698cefb9edabffd14290123f439a84790.tar.bz2
issue23591: more docs; slight change to repr
Diffstat (limited to 'Lib/enum.py')
-rw-r--r--Lib/enum.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/Lib/enum.py b/Lib/enum.py
index 1e028a3..6a18999 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -692,14 +692,11 @@ class Flag(Enum):
if self._name_ is not None:
return '<%s.%s: %r>' % (cls.__name__, self._name_, self._value_)
members = self._decompose_()
- if len(members) == 1 and members[0]._name_ is None:
- return '<%s: %r>' % (cls.__name__, members[0]._value_)
- else:
- return '<%s.%s: %r>' % (
- cls.__name__,
- '|'.join([str(m._name_ or m._value_) for m in members]),
- self._value_,
- )
+ return '<%s.%s: %r>' % (
+ cls.__name__,
+ '|'.join([str(m._name_ or m._value_) for m in members]),
+ self._value_,
+ )
def __str__(self):
cls = self.__class__