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
6fcf9b50
Kaydet (Commit)
6fcf9b50
authored
Eyl 01, 2009
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
remove the check that classmethod's argument is a callable
üst
8514b85e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
17 deletions
+5
-17
test_descr.py
Lib/test/test_descr.py
+3
-7
NEWS
Misc/NEWS
+2
-0
classobject.c
Objects/classobject.c
+0
-4
funcobject.c
Objects/funcobject.c
+0
-6
No files found.
Lib/test/test_descr.py
Dosyayı görüntüle @
6fcf9b50
...
@@ -1391,13 +1391,9 @@ order (MRO) for bases """
...
@@ -1391,13 +1391,9 @@ order (MRO) for bases """
self
.
assertEqual
(
super
(
D
,
D
)
.
goo
(),
(
D
,))
self
.
assertEqual
(
super
(
D
,
D
)
.
goo
(),
(
D
,))
self
.
assertEqual
(
super
(
D
,
d
)
.
goo
(),
(
D
,))
self
.
assertEqual
(
super
(
D
,
d
)
.
goo
(),
(
D
,))
# Verify that argument is checked for callability (SF bug 753451)
# Verify that a non-callable will raise
try
:
meth
=
classmethod
(
1
)
.
__get__
(
1
)
classmethod
(
1
)
.
__get__
(
1
)
self
.
assertRaises
(
TypeError
,
meth
)
except
TypeError
:
pass
else
:
self
.
fail
(
"classmethod should check for callability"
)
# Verify that classmethod() doesn't allow keyword args
# Verify that classmethod() doesn't allow keyword args
try
:
try
:
...
...
Misc/NEWS
Dosyayı görüntüle @
6fcf9b50
...
@@ -12,6 +12,8 @@ What's New in Python 2.7 alpha 1
...
@@ -12,6 +12,8 @@ What's New in Python 2.7 alpha 1
Core and Builtins
Core and Builtins
-----------------
-----------------
- classmethod no longer checks if its argument is callable.
- Issue #6750: A text file opened with io.open() could duplicate its output
- Issue #6750: A text file opened with io.open() could duplicate its output
when writing from multiple threads at the same time.
when writing from multiple threads at the same time.
...
...
Objects/classobject.c
Dosyayı görüntüle @
6fcf9b50
...
@@ -2226,10 +2226,6 @@ PyObject *
...
@@ -2226,10 +2226,6 @@ PyObject *
PyMethod_New
(
PyObject
*
func
,
PyObject
*
self
,
PyObject
*
klass
)
PyMethod_New
(
PyObject
*
func
,
PyObject
*
self
,
PyObject
*
klass
)
{
{
register
PyMethodObject
*
im
;
register
PyMethodObject
*
im
;
if
(
!
PyCallable_Check
(
func
))
{
PyErr_BadInternalCall
();
return
NULL
;
}
im
=
free_list
;
im
=
free_list
;
if
(
im
!=
NULL
)
{
if
(
im
!=
NULL
)
{
free_list
=
(
PyMethodObject
*
)(
im
->
im_self
);
free_list
=
(
PyMethodObject
*
)(
im
->
im_self
);
...
...
Objects/funcobject.c
Dosyayı görüntüle @
6fcf9b50
...
@@ -659,12 +659,6 @@ cm_init(PyObject *self, PyObject *args, PyObject *kwds)
...
@@ -659,12 +659,6 @@ cm_init(PyObject *self, PyObject *args, PyObject *kwds)
return
-
1
;
return
-
1
;
if
(
!
_PyArg_NoKeywords
(
"classmethod"
,
kwds
))
if
(
!
_PyArg_NoKeywords
(
"classmethod"
,
kwds
))
return
-
1
;
return
-
1
;
if
(
!
PyCallable_Check
(
callable
))
{
PyErr_Format
(
PyExc_TypeError
,
"'%s' object is not callable"
,
callable
->
ob_type
->
tp_name
);
return
-
1
;
}
Py_INCREF
(
callable
);
Py_INCREF
(
callable
);
cm
->
cm_callable
=
callable
;
cm
->
cm_callable
=
callable
;
return
0
;
return
0
;
...
...
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