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
ab7cc759
Kaydet (Commit)
ab7cc759
authored
Agu 18, 2015
tarafından
Yury Selivanov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #23572: Fixed functools.singledispatch on classes with falsy metaclasses.
Patch by Ethan Furman.
üst
a78ebe63
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletion
+22
-1
functools.py
Lib/functools.py
+1
-1
test_functools.py
Lib/test/test_functools.py
+18
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/functools.py
Dosyayı görüntüle @
ab7cc759
...
@@ -551,7 +551,7 @@ def _c3_merge(sequences):
...
@@ -551,7 +551,7 @@ def _c3_merge(sequences):
break
# reject the current head, it appears later
break
# reject the current head, it appears later
else
:
else
:
break
break
if
not
candidat
e
:
if
candidate
is
Non
e
:
raise
RuntimeError
(
"Inconsistent hierarchy"
)
raise
RuntimeError
(
"Inconsistent hierarchy"
)
result
.
append
(
candidate
)
result
.
append
(
candidate
)
# remove the chosen candidate
# remove the chosen candidate
...
...
Lib/test/test_functools.py
Dosyayı görüntüle @
ab7cc759
...
@@ -1328,6 +1328,24 @@ class TestSingleDispatch(unittest.TestCase):
...
@@ -1328,6 +1328,24 @@ class TestSingleDispatch(unittest.TestCase):
many_abcs
=
[
c
.
Mapping
,
c
.
Sized
,
c
.
Callable
,
c
.
Container
,
c
.
Iterable
]
many_abcs
=
[
c
.
Mapping
,
c
.
Sized
,
c
.
Callable
,
c
.
Container
,
c
.
Iterable
]
self
.
assertEqual
(
mro
(
X
,
abcs
=
many_abcs
),
expected
)
self
.
assertEqual
(
mro
(
X
,
abcs
=
many_abcs
),
expected
)
def
test_false_meta
(
self
):
# see issue23572
class
MetaA
(
type
):
def
__len__
(
self
):
return
0
class
A
(
metaclass
=
MetaA
):
pass
class
AA
(
A
):
pass
@functools.singledispatch
def
fun
(
a
):
return
'base A'
@fun.register
(
A
)
def
_
(
a
):
return
'fun A'
aa
=
AA
()
self
.
assertEqual
(
fun
(
aa
),
'fun A'
)
def
test_mro_conflicts
(
self
):
def
test_mro_conflicts
(
self
):
c
=
collections
c
=
collections
@functools.singledispatch
@functools.singledispatch
...
...
Misc/NEWS
Dosyayı görüntüle @
ab7cc759
...
@@ -392,6 +392,9 @@ Library
...
@@ -392,6 +392,9 @@ Library
- Issue #24298: Fix inspect.signature() to correctly unwrap wrappers
- Issue #24298: Fix inspect.signature() to correctly unwrap wrappers
around bound methods.
around bound methods.
- Issue #23572: Fixed functools.singledispatch on classes with falsy
metaclasses. Patch by Ethan Furman.
IDLE
IDLE
----
----
...
...
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