Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
6db1fd5f
Kaydet (Commit)
6db1fd5f
authored
Eyl 18, 2015
tarafından
Ethan Furman
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Close issue24840: Enum._value_ is queried for bool(); original patch by Mike Lundy
üst
b1a3d9ae
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
0 deletions
+11
-0
enum.py
Lib/enum.py
+3
-0
test_enum.py
Lib/test/test_enum.py
+7
-0
ACKS
Misc/ACKS
+1
-0
No files found.
Lib/enum.py
Dosyayı görüntüle @
6db1fd5f
...
...
@@ -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
...
...
Lib/test/test_enum.py
Dosyayı görüntüle @
6db1fd5f
...
...
@@ -270,6 +270,13 @@ class TestEnum(unittest.TestCase):
class
Wrong
(
Enum
):
_any_name_
=
9
def
test_bool
(
self
):
class
Logic
(
Enum
):
true
=
True
false
=
False
self
.
assertTrue
(
Logic
.
true
)
self
.
assertFalse
(
Logic
.
false
)
def
test_contains
(
self
):
Season
=
self
.
Season
self
.
assertIn
(
Season
.
AUTUMN
,
Season
)
...
...
Misc/ACKS
Dosyayı görüntüle @
6db1fd5f
...
...
@@ -877,6 +877,7 @@ Kang-Hao (Kenny) Lu
Lukas Lueg
Loren Luke
Fredrik Lundh
Mike Lundy
Zhongyue Luo
Mark Lutz
Taras Lyapun
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment