mirror of
https://github.com/python/cpython.git
synced 2025-08-24 18:55:00 +00:00
Close issue24840: Enum._value_ is queried for bool(); original patch by Mike Lundy
This commit is contained in:
parent
b1a3d9ae56
commit
6db1fd5fb8
3 changed files with 11 additions and 0 deletions
|
@ -476,6 +476,9 @@ class Enum(metaclass=EnumMeta):
|
|||
def __str__(self):
|
||||
return "%s.%s" % (self.__class__.__name__, self._name_)
|
||||
|
||||
def __bool__(self):
|
||||
return bool(self._value_)
|
||||
|
||||
def __dir__(self):
|
||||
added_behavior = [
|
||||
m
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue