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
f2fc934a
Kaydet (Commit)
f2fc934a
authored
Eyl 01, 2007
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Get rid of METH_OLDARGS.
üst
55ac8f0f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
24 deletions
+5
-24
newtypes.rst
Doc/c-api/newtypes.rst
+0
-10
methodobject.h
Include/methodobject.h
+1
-1
methodobject.c
Objects/methodobject.c
+4
-13
No files found.
Doc/c-api/newtypes.rst
Dosyayı görüntüle @
f2fc934a
...
...
@@ -255,16 +255,6 @@ convention flags can be combined with a binding flag.
:ctype:`PyObject\*` parameter representing the single argument.
.. XXX deprecated, should be removed
.. data:: METH_OLDARGS
This calling convention is deprecated. The method must be of type
:ctype:`PyCFunction`. The second argument is *NULL* if no arguments are given,
a single object if exactly one argument is given, and a tuple of objects if more
than one argument is given. There is no way for a function using this
convention to distinguish between a call with multiple arguments and a call with
a tuple as the only argument.
These two constants are not used to indicate the calling convention but the
binding when use with methods of classes. These may not be used for functions
defined for modules. At most one of these flags may be set for any given
...
...
Include/methodobject.h
Dosyayı görüntüle @
f2fc934a
...
...
@@ -50,7 +50,7 @@ PyAPI_FUNC(PyObject *) PyCFunction_NewEx(PyMethodDef *, PyObject *,
PyObject
*
);
/* Flag passed to newmethodobject */
#define METH_OLDARGS 0x0000
/* #define METH_OLDARGS 0x0000 -- unsupported now */
#define METH_VARARGS 0x0001
#define METH_KEYWORDS 0x0002
/* METH_NOARGS and METH_O must not be combined with the flags above. */
...
...
Objects/methodobject.c
Dosyayı görüntüle @
f2fc934a
...
...
@@ -73,7 +73,6 @@ PyCFunction_Call(PyObject *func, PyObject *arg, PyObject *kw)
return
(
*
meth
)(
self
,
arg
);
break
;
case
METH_VARARGS
|
METH_KEYWORDS
:
case
METH_OLDARGS
|
METH_KEYWORDS
:
return
(
*
(
PyCFunctionWithKeywords
)
meth
)(
self
,
arg
,
kw
);
case
METH_NOARGS
:
if
(
kw
==
NULL
||
PyDict_Size
(
kw
)
==
0
)
{
...
...
@@ -97,19 +96,11 @@ PyCFunction_Call(PyObject *func, PyObject *arg, PyObject *kw)
return
NULL
;
}
break
;
case
METH_OLDARGS
:
/* the really old style */
if
(
kw
==
NULL
||
PyDict_Size
(
kw
)
==
0
)
{
size
=
PyTuple_GET_SIZE
(
arg
);
if
(
size
==
1
)
arg
=
PyTuple_GET_ITEM
(
arg
,
0
);
else
if
(
size
==
0
)
arg
=
NULL
;
return
(
*
meth
)(
self
,
arg
);
}
break
;
default:
PyErr_BadInternalCall
();
PyErr_SetString
(
PyExc_SystemError
,
"Bad call flags in "
"PyCFunction_Call. METH_OLDARGS is no "
"longer supported!"
);
return
NULL
;
}
PyErr_Format
(
PyExc_TypeError
,
"%.200s() takes no keyword arguments"
,
...
...
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