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
3803ad47
Kaydet (Commit)
3803ad47
authored
May 01, 2016
tarafından
Ethan Furman
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
issue26893: use mro() to examine class heirarchy
üst
dd1bcdf6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
enum.py
Lib/enum.py
+1
-1
test_enum.py
Lib/test/test_enum.py
+13
-0
No files found.
Lib/enum.py
Dosyayı görüntüle @
3803ad47
...
@@ -118,7 +118,7 @@ class EnumMeta(type):
...
@@ -118,7 +118,7 @@ class EnumMeta(type):
# save attributes from super classes so we know if we can take
# save attributes from super classes so we know if we can take
# the shortcut of storing members in the class dict
# the shortcut of storing members in the class dict
base_attributes
=
{
a
for
b
in
bases
for
a
in
b
.
__dict__
}
base_attributes
=
{
a
for
b
in
enum_class
.
mro
()
for
a
in
b
.
__dict__
}
# Reverse value->name map for hashable values.
# Reverse value->name map for hashable values.
enum_class
.
_value2member_map_
=
{}
enum_class
.
_value2member_map_
=
{}
...
...
Lib/test/test_enum.py
Dosyayı görüntüle @
3803ad47
...
@@ -1568,6 +1568,19 @@ class TestUnique(unittest.TestCase):
...
@@ -1568,6 +1568,19 @@ class TestUnique(unittest.TestCase):
triple
=
3
triple
=
3
turkey
=
3
turkey
=
3
def
test_unique_with_name
(
self
):
@unique
class
Silly
(
Enum
):
one
=
1
two
=
'dos'
name
=
3
@unique
class
Sillier
(
IntEnum
):
single
=
1
name
=
2
triple
=
3
value
=
4
expected_help_output_with_docs
=
"""
\
expected_help_output_with_docs
=
"""
\
Help on class Color in module
%
s:
Help on class Color in module
%
s:
...
...
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