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
155db9aa
Kaydet (Commit)
155db9aa
authored
Nis 02, 2002
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
SF patch 537536 by Phillip J. Eby, fix for SF bug 535444, super()
broken w/ classmethods. Bugfix candidate.
üst
103b548a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
test_descr.py
Lib/test/test_descr.py
+8
-0
typeobject.c
Objects/typeobject.c
+7
-3
No files found.
Lib/test/test_descr.py
Dosyayı görüntüle @
155db9aa
...
...
@@ -1214,6 +1214,14 @@ def classmethods():
vereq
(
ff
.
__get__
(
0
,
int
)(
42
),
(
int
,
42
))
vereq
(
ff
.
__get__
(
0
)(
42
),
(
int
,
42
))
# Test super() with classmethods (SF bug 535444)
veris
(
C
.
goo
.
im_self
,
C
)
veris
(
D
.
goo
.
im_self
,
D
)
veris
(
super
(
D
,
D
)
.
goo
.
im_self
,
D
)
veris
(
super
(
D
,
d
)
.
goo
.
im_self
,
D
)
vereq
(
super
(
D
,
D
)
.
goo
(),
(
D
,))
vereq
(
super
(
D
,
d
)
.
goo
(),
(
D
,))
def
classmethods_in_c
():
if
verbose
:
print
"Testing C-based class methods..."
import
xxsubtype
as
spam
...
...
Objects/typeobject.c
Dosyayı görüntüle @
155db9aa
...
...
@@ -4021,10 +4021,13 @@ super_getattro(PyObject *self, PyObject *name)
if
(
su
->
obj
!=
NULL
)
{
PyObject
*
mro
,
*
res
,
*
tmp
,
*
dict
;
PyTypeObject
*
starttype
;
descrgetfunc
f
;
int
i
,
n
;
mro
=
su
->
obj
->
ob_type
->
tp_mro
;
starttype
=
su
->
obj
->
ob_type
;
mro
=
starttype
->
tp_mro
;
if
(
mro
==
NULL
)
n
=
0
;
else
{
...
...
@@ -4036,7 +4039,8 @@ super_getattro(PyObject *self, PyObject *name)
break
;
}
if
(
i
>=
n
&&
PyType_Check
(
su
->
obj
))
{
mro
=
((
PyTypeObject
*
)(
su
->
obj
))
->
tp_mro
;
starttype
=
(
PyTypeObject
*
)(
su
->
obj
);
mro
=
starttype
->
tp_mro
;
if
(
mro
==
NULL
)
n
=
0
;
else
{
...
...
@@ -4064,7 +4068,7 @@ super_getattro(PyObject *self, PyObject *name)
Py_INCREF
(
res
);
f
=
res
->
ob_type
->
tp_descr_get
;
if
(
f
!=
NULL
)
{
tmp
=
f
(
res
,
su
->
obj
,
res
);
tmp
=
f
(
res
,
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