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
91a968af
Kaydet (Commit)
91a968af
authored
Mar 25, 2004
tarafından
Phillip J. Eby
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Ensure super() lookup of descriptor from classmethod works (SF #743627)
üst
2786d906
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
test_descr.py
Lib/test/test_descr.py
+14
-0
typeobject.c
Objects/typeobject.c
+8
-1
No files found.
Lib/test/test_descr.py
Dosyayı görüntüle @
91a968af
...
...
@@ -2064,6 +2064,20 @@ def supers():
vereq
(
dd
.
x
,
"hello"
)
vereq
(
super
(
DDsub
,
dd
)
.
x
,
42
)
# Ensure that super() lookup of descriptor from classmethod
# works (SF ID# 743627)
class
Base
(
object
):
aProp
=
property
(
lambda
self
:
"foo"
)
class
Sub
(
Base
):
def
test
(
klass
):
return
super
(
Sub
,
klass
)
.
aProp
test
=
classmethod
(
test
)
veris
(
Sub
.
test
(),
Base
.
aProp
)
def
inherits
():
if
verbose
:
print
"Testing inheritance from basic types..."
...
...
Objects/typeobject.c
Dosyayı görüntüle @
91a968af
...
...
@@ -5537,7 +5537,14 @@ super_getattro(PyObject *self, PyObject *name)
Py_INCREF
(
res
);
f
=
res
->
ob_type
->
tp_descr_get
;
if
(
f
!=
NULL
)
{
tmp
=
f
(
res
,
su
->
obj
,
tmp
=
f
(
res
,
/* Only pass 'obj' param if
this is instance-mode super
(See SF ID #743627)
*/
(
su
->
obj
==
su
->
obj_type
?
(
PyObject
*
)
NULL
:
su
->
obj
),
(
PyObject
*
)
starttype
);
Py_DECREF
(
res
);
res
=
tmp
;
...
...
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