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
b900d6a7
Kaydet (Commit)
b900d6a7
authored
Şub 19, 2012
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
initialize __dict__ if needed
üst
488a56d2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
test_descr.py
Lib/test/test_descr.py
+2
-0
funcobject.c
Objects/funcobject.c
+12
-6
No files found.
Lib/test/test_descr.py
Dosyayı görüntüle @
b900d6a7
...
@@ -1444,6 +1444,7 @@ order (MRO) for bases """
...
@@ -1444,6 +1444,7 @@ order (MRO) for bases """
self
.
fail
(
"classmethod shouldn't accept keyword args"
)
self
.
fail
(
"classmethod shouldn't accept keyword args"
)
cm
=
classmethod
(
f
)
cm
=
classmethod
(
f
)
self
.
assertEqual
(
cm
.
__dict__
,
{})
cm
.
x
=
42
cm
.
x
=
42
self
.
assertEqual
(
cm
.
x
,
42
)
self
.
assertEqual
(
cm
.
x
,
42
)
self
.
assertEqual
(
cm
.
__dict__
,
{
"x"
:
42
})
self
.
assertEqual
(
cm
.
__dict__
,
{
"x"
:
42
})
...
@@ -1482,6 +1483,7 @@ order (MRO) for bases """
...
@@ -1482,6 +1483,7 @@ order (MRO) for bases """
self
.
assertEqual
(
d
.
foo
(
1
),
(
d
,
1
))
self
.
assertEqual
(
d
.
foo
(
1
),
(
d
,
1
))
self
.
assertEqual
(
D
.
foo
(
d
,
1
),
(
d
,
1
))
self
.
assertEqual
(
D
.
foo
(
d
,
1
),
(
d
,
1
))
sm
=
staticmethod
(
None
)
sm
=
staticmethod
(
None
)
self
.
assertEqual
(
sm
.
__dict__
,
{})
sm
.
x
=
42
sm
.
x
=
42
self
.
assertEqual
(
sm
.
x
,
42
)
self
.
assertEqual
(
sm
.
x
,
42
)
self
.
assertEqual
(
sm
.
__dict__
,
{
"x"
:
42
})
self
.
assertEqual
(
sm
.
__dict__
,
{
"x"
:
42
})
...
...
Objects/funcobject.c
Dosyayı görüntüle @
b900d6a7
...
@@ -832,10 +832,13 @@ cm_get___isabstractmethod__(classmethod *cm, void *closure)
...
@@ -832,10 +832,13 @@ cm_get___isabstractmethod__(classmethod *cm, void *closure)
}
}
static
PyObject
*
static
PyObject
*
cm_get___dict__
(
classmethod
*
cm
,
void
*
closure
)
cm_get___dict__
(
PyObject
*
cm
,
void
*
closure
)
{
{
Py_INCREF
(
cm
->
cm_dict
);
PyObject
**
dictptr
=
_PyObject_GetDictPtr
(
cm
);
return
cm
->
cm_dict
;
if
(
*
dictptr
==
NULL
)
*
dictptr
=
PyDict_New
();
Py_XINCREF
(
*
dictptr
);
return
*
dictptr
;
}
}
static
PyGetSetDef
cm_getsetlist
[]
=
{
static
PyGetSetDef
cm_getsetlist
[]
=
{
...
@@ -1018,10 +1021,13 @@ sm_get___isabstractmethod__(staticmethod *sm, void *closure)
...
@@ -1018,10 +1021,13 @@ sm_get___isabstractmethod__(staticmethod *sm, void *closure)
}
}
static
PyObject
*
static
PyObject
*
sm_get___dict__
(
staticmethod
*
sm
,
void
*
closure
)
sm_get___dict__
(
PyObject
*
sm
,
void
*
closure
)
{
{
Py_INCREF
(
sm
->
sm_dict
);
PyObject
**
dictptr
=
_PyObject_GetDictPtr
(
sm
);
return
sm
->
sm_dict
;
if
(
*
dictptr
==
NULL
)
*
dictptr
=
PyDict_New
();
Py_XINCREF
(
*
dictptr
);
return
*
dictptr
;
}
}
static
PyGetSetDef
sm_getsetlist
[]
=
{
static
PyGetSetDef
sm_getsetlist
[]
=
{
...
...
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