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
77a8cd65
Kaydet (Commit)
77a8cd65
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
f5e0c41d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
1 deletion
+42
-1
functools.py
Lib/functools.py
+1
-1
test_functools.py
Lib/test/test_functools.py
+18
-0
NEWS
Misc/NEWS
+23
-0
No files found.
Lib/functools.py
Dosyayı görüntüle @
77a8cd65
...
...
@@ -567,7 +567,7 @@ def _c3_merge(sequences):
break
# reject the current head, it appears later
else
:
break
if
not
candidat
e
:
if
candidate
is
Non
e
:
raise
RuntimeError
(
"Inconsistent hierarchy"
)
result
.
append
(
candidate
)
# remove the chosen candidate
...
...
Lib/test/test_functools.py
Dosyayı görüntüle @
77a8cd65
...
...
@@ -1491,6 +1491,24 @@ class TestSingleDispatch(unittest.TestCase):
many_abcs
=
[
c
.
Mapping
,
c
.
Sized
,
c
.
Callable
,
c
.
Container
,
c
.
Iterable
]
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
):
c
=
collections
@functools.singledispatch
...
...
Misc/NEWS
Dosyayı görüntüle @
77a8cd65
...
...
@@ -2,6 +2,29 @@
Python
News
+++++++++++
What
's New in Python 3.5.1
==========================
Release date: TBA
Core and Builtins
-----------------
Library
-------
- Issue #23572: Fixed functools.singledispatch on classes with falsy
metaclasses. Patch by Ethan Furman.
Documentation
-------------
What'
s
New
in
Python
3.5.0
release
candidate
2
?
===============================================
...
...
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