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
3cceb384
Kaydet (Commit)
3cceb384
authored
Ock 04, 2014
tarafından
Larry Hastings
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #19976: Argument Clinic METH_NOARGS functions now always
take two parameters.
üst
583a9394
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
150 additions
and
31 deletions
+150
-31
pymacro.h
Include/pymacro.h
+6
-0
NEWS
Misc/NEWS
+5
-0
_pickle.c
Modules/_pickle.c
+122
-18
zlibmodule.c
Modules/zlibmodule.c
+15
-2
clinic.py
Tools/clinic/clinic.py
+2
-11
No files found.
Include/pymacro.h
Dosyayı görüntüle @
3cceb384
...
@@ -69,4 +69,10 @@
...
@@ -69,4 +69,10 @@
/* Check if pointer "p" is aligned to "a"-bytes boundary. */
/* Check if pointer "p" is aligned to "a"-bytes boundary. */
#define _Py_IS_ALIGNED(p, a) (!((Py_uintptr_t)(p) & (Py_uintptr_t)((a) - 1)))
#define _Py_IS_ALIGNED(p, a) (!((Py_uintptr_t)(p) & (Py_uintptr_t)((a) - 1)))
#ifdef __GNUC__
#define Py_UNUSED(name) _unused_ ## name __attribute__((unused))
#else
#define Py_UNUSED(name) _unused_ ## name
#endif
#endif
/* Py_PYMACRO_H */
#endif
/* Py_PYMACRO_H */
Misc/NEWS
Dosyayı görüntüle @
3cceb384
...
@@ -342,6 +342,11 @@ Documentation
...
@@ -342,6 +342,11 @@ Documentation
-
Issue
#
19795
:
Improved
markup
of
True
/
False
constants
.
-
Issue
#
19795
:
Improved
markup
of
True
/
False
constants
.
Tools
/
Demos
-----------
-
Issue
#
19976
:
Argument
Clinic
METH_NOARGS
functions
now
always
take
two
parameters
.
What
's New in Python 3.4.0 Beta 1?
What
's New in Python 3.4.0 Beta 1?
==================================
==================================
...
...
Modules/_pickle.c
Dosyayı görüntüle @
3cceb384
...
@@ -3901,8 +3901,21 @@ PyDoc_STRVAR(_pickle_Pickler_clear_memo__doc__,
...
@@ -3901,8 +3901,21 @@ PyDoc_STRVAR(_pickle_Pickler_clear_memo__doc__,
{"clear_memo", (PyCFunction)_pickle_Pickler_clear_memo, METH_NOARGS, _pickle_Pickler_clear_memo__doc__},
{"clear_memo", (PyCFunction)_pickle_Pickler_clear_memo, METH_NOARGS, _pickle_Pickler_clear_memo__doc__},
static
PyObject
*
static
PyObject
*
_pickle_Pickler_clear_memo
(
PicklerObject
*
self
)
_pickle_Pickler_clear_memo_impl
(
PicklerObject
*
self
);
/*[clinic checksum: 9c32be7e7a17ff82a81aae409d0d4f469033a5b2]*/
static
PyObject
*
_pickle_Pickler_clear_memo
(
PyObject
*
self
,
PyObject
*
Py_UNUSED
(
ignored
))
{
PyObject
*
return_value
=
NULL
;
return_value
=
_pickle_Pickler_clear_memo_impl
((
PicklerObject
*
)
self
);
return
return_value
;
}
static
PyObject
*
_pickle_Pickler_clear_memo_impl
(
PicklerObject
*
self
)
/*[clinic checksum: 0574593b102fffb8e781d7bb9b536ceffc525ac1]*/
{
{
if
(
self
->
memo
)
if
(
self
->
memo
)
PyMemoTable_Clear
(
self
->
memo
);
PyMemoTable_Clear
(
self
->
memo
);
...
@@ -4176,8 +4189,21 @@ PyDoc_STRVAR(_pickle_PicklerMemoProxy_clear__doc__,
...
@@ -4176,8 +4189,21 @@ PyDoc_STRVAR(_pickle_PicklerMemoProxy_clear__doc__,
{"clear", (PyCFunction)_pickle_PicklerMemoProxy_clear, METH_NOARGS, _pickle_PicklerMemoProxy_clear__doc__},
{"clear", (PyCFunction)_pickle_PicklerMemoProxy_clear, METH_NOARGS, _pickle_PicklerMemoProxy_clear__doc__},
static
PyObject
*
static
PyObject
*
_pickle_PicklerMemoProxy_clear
(
PicklerMemoProxyObject
*
self
)
_pickle_PicklerMemoProxy_clear_impl
(
PicklerMemoProxyObject
*
self
);
/*[clinic checksum: 507f13938721992e175a3e58b5ad02620045a1cc]*/
static
PyObject
*
_pickle_PicklerMemoProxy_clear
(
PyObject
*
self
,
PyObject
*
Py_UNUSED
(
ignored
))
{
PyObject
*
return_value
=
NULL
;
return_value
=
_pickle_PicklerMemoProxy_clear_impl
((
PicklerMemoProxyObject
*
)
self
);
return
return_value
;
}
static
PyObject
*
_pickle_PicklerMemoProxy_clear_impl
(
PicklerMemoProxyObject
*
self
)
/*[clinic checksum: c6ca252530ccb3ea2f4b33507b51b183f23b24c7]*/
{
{
if
(
self
->
pickler
->
memo
)
if
(
self
->
pickler
->
memo
)
PyMemoTable_Clear
(
self
->
pickler
->
memo
);
PyMemoTable_Clear
(
self
->
pickler
->
memo
);
...
@@ -4200,8 +4226,21 @@ PyDoc_STRVAR(_pickle_PicklerMemoProxy_copy__doc__,
...
@@ -4200,8 +4226,21 @@ PyDoc_STRVAR(_pickle_PicklerMemoProxy_copy__doc__,
{"copy", (PyCFunction)_pickle_PicklerMemoProxy_copy, METH_NOARGS, _pickle_PicklerMemoProxy_copy__doc__},
{"copy", (PyCFunction)_pickle_PicklerMemoProxy_copy, METH_NOARGS, _pickle_PicklerMemoProxy_copy__doc__},
static
PyObject
*
static
PyObject
*
_pickle_PicklerMemoProxy_copy
(
PicklerMemoProxyObject
*
self
)
_pickle_PicklerMemoProxy_copy_impl
(
PicklerMemoProxyObject
*
self
);
/*[clinic checksum: 73a5117ab354290ebdbe07bd0bf7232d0936a69d]*/
static
PyObject
*
_pickle_PicklerMemoProxy_copy
(
PyObject
*
self
,
PyObject
*
Py_UNUSED
(
ignored
))
{
PyObject
*
return_value
=
NULL
;
return_value
=
_pickle_PicklerMemoProxy_copy_impl
((
PicklerMemoProxyObject
*
)
self
);
return
return_value
;
}
static
PyObject
*
_pickle_PicklerMemoProxy_copy_impl
(
PicklerMemoProxyObject
*
self
)
/*[clinic checksum: 808c4d5a37359ed5fb2efe81dbe5ff480719f470]*/
{
{
Py_ssize_t
i
;
Py_ssize_t
i
;
PyMemoTable
*
memo
;
PyMemoTable
*
memo
;
...
@@ -4254,11 +4293,24 @@ PyDoc_STRVAR(_pickle_PicklerMemoProxy___reduce____doc__,
...
@@ -4254,11 +4293,24 @@ PyDoc_STRVAR(_pickle_PicklerMemoProxy___reduce____doc__,
{"__reduce__", (PyCFunction)_pickle_PicklerMemoProxy___reduce__, METH_NOARGS, _pickle_PicklerMemoProxy___reduce____doc__},
{"__reduce__", (PyCFunction)_pickle_PicklerMemoProxy___reduce__, METH_NOARGS, _pickle_PicklerMemoProxy___reduce____doc__},
static
PyObject
*
static
PyObject
*
_pickle_PicklerMemoProxy___reduce__
(
PicklerMemoProxyObject
*
self
)
_pickle_PicklerMemoProxy___reduce___impl
(
PicklerMemoProxyObject
*
self
);
/*[clinic checksum: 40f0bf7a9b161e77130674f0481bda0a0184dcce]*/
static
PyObject
*
_pickle_PicklerMemoProxy___reduce__
(
PyObject
*
self
,
PyObject
*
Py_UNUSED
(
ignored
))
{
PyObject
*
return_value
=
NULL
;
return_value
=
_pickle_PicklerMemoProxy___reduce___impl
((
PicklerMemoProxyObject
*
)
self
);
return
return_value
;
}
static
PyObject
*
_pickle_PicklerMemoProxy___reduce___impl
(
PicklerMemoProxyObject
*
self
)
/*[clinic checksum: 2293152bdf53951a012d430767b608f5fb4213b5]*/
{
{
PyObject
*
reduce_value
,
*
dict_args
;
PyObject
*
reduce_value
,
*
dict_args
;
PyObject
*
contents
=
_pickle_PicklerMemoProxy_copy
(
self
);
PyObject
*
contents
=
_pickle_PicklerMemoProxy_copy
_impl
(
self
);
if
(
contents
==
NULL
)
if
(
contents
==
NULL
)
return
NULL
;
return
NULL
;
...
@@ -6288,8 +6340,21 @@ PyDoc_STRVAR(_pickle_Unpickler_load__doc__,
...
@@ -6288,8 +6340,21 @@ PyDoc_STRVAR(_pickle_Unpickler_load__doc__,
{"load", (PyCFunction)_pickle_Unpickler_load, METH_NOARGS, _pickle_Unpickler_load__doc__},
{"load", (PyCFunction)_pickle_Unpickler_load, METH_NOARGS, _pickle_Unpickler_load__doc__},
static
PyObject
*
static
PyObject
*
_pickle_Unpickler_load
(
PyObject
*
self
)
_pickle_Unpickler_load_impl
(
PyObject
*
self
);
/*[clinic checksum: c2ae1263f0dd000f34ccf0fe59d7c544464babc4]*/
static
PyObject
*
_pickle_Unpickler_load
(
PyObject
*
self
,
PyObject
*
Py_UNUSED
(
ignored
))
{
PyObject
*
return_value
=
NULL
;
return_value
=
_pickle_Unpickler_load_impl
(
self
);
return
return_value
;
}
static
PyObject
*
_pickle_Unpickler_load_impl
(
PyObject
*
self
)
/*[clinic checksum: 55f35fcaf034817e75c355ec50b7878577355899]*/
{
{
UnpicklerObject
*
unpickler
=
(
UnpicklerObject
*
)
self
;
UnpicklerObject
*
unpickler
=
(
UnpicklerObject
*
)
self
;
...
@@ -6688,8 +6753,21 @@ PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_clear__doc__,
...
@@ -6688,8 +6753,21 @@ PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_clear__doc__,
{"clear", (PyCFunction)_pickle_UnpicklerMemoProxy_clear, METH_NOARGS, _pickle_UnpicklerMemoProxy_clear__doc__},
{"clear", (PyCFunction)_pickle_UnpicklerMemoProxy_clear, METH_NOARGS, _pickle_UnpicklerMemoProxy_clear__doc__},
static
PyObject
*
static
PyObject
*
_pickle_UnpicklerMemoProxy_clear
(
UnpicklerMemoProxyObject
*
self
)
_pickle_UnpicklerMemoProxy_clear_impl
(
UnpicklerMemoProxyObject
*
self
);
/*[clinic checksum: 46fecf4e33c0c873124f845edf6cc3a2e9864bd5]*/
static
PyObject
*
_pickle_UnpicklerMemoProxy_clear
(
PyObject
*
self
,
PyObject
*
Py_UNUSED
(
ignored
))
{
PyObject
*
return_value
=
NULL
;
return_value
=
_pickle_UnpicklerMemoProxy_clear_impl
((
UnpicklerMemoProxyObject
*
)
self
);
return
return_value
;
}
static
PyObject
*
_pickle_UnpicklerMemoProxy_clear_impl
(
UnpicklerMemoProxyObject
*
self
)
/*[clinic checksum: e0f99c26d48444a3f58f598bec3190c66595fce7]*/
{
{
_Unpickler_MemoCleanup
(
self
->
unpickler
);
_Unpickler_MemoCleanup
(
self
->
unpickler
);
self
->
unpickler
->
memo
=
_Unpickler_NewMemo
(
self
->
unpickler
->
memo_size
);
self
->
unpickler
->
memo
=
_Unpickler_NewMemo
(
self
->
unpickler
->
memo_size
);
...
@@ -6714,8 +6792,21 @@ PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_copy__doc__,
...
@@ -6714,8 +6792,21 @@ PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_copy__doc__,
{"copy", (PyCFunction)_pickle_UnpicklerMemoProxy_copy, METH_NOARGS, _pickle_UnpicklerMemoProxy_copy__doc__},
{"copy", (PyCFunction)_pickle_UnpicklerMemoProxy_copy, METH_NOARGS, _pickle_UnpicklerMemoProxy_copy__doc__},
static
PyObject
*
static
PyObject
*
_pickle_UnpicklerMemoProxy_copy
(
UnpicklerMemoProxyObject
*
self
)
_pickle_UnpicklerMemoProxy_copy_impl
(
UnpicklerMemoProxyObject
*
self
);
/*[clinic checksum: f8856c4e8a33540886dfbb245f286af3008fa0ad]*/
static
PyObject
*
_pickle_UnpicklerMemoProxy_copy
(
PyObject
*
self
,
PyObject
*
Py_UNUSED
(
ignored
))
{
PyObject
*
return_value
=
NULL
;
return_value
=
_pickle_UnpicklerMemoProxy_copy_impl
((
UnpicklerMemoProxyObject
*
)
self
);
return
return_value
;
}
static
PyObject
*
_pickle_UnpicklerMemoProxy_copy_impl
(
UnpicklerMemoProxyObject
*
self
)
/*[clinic checksum: 8c0ab91c0b694ea71a1774650898a760d1ab4765]*/
{
{
Py_ssize_t
i
;
Py_ssize_t
i
;
PyObject
*
new_memo
=
PyDict_New
();
PyObject
*
new_memo
=
PyDict_New
();
...
@@ -6761,12 +6852,25 @@ PyDoc_STRVAR(_pickle_UnpicklerMemoProxy___reduce____doc__,
...
@@ -6761,12 +6852,25 @@ PyDoc_STRVAR(_pickle_UnpicklerMemoProxy___reduce____doc__,
{"__reduce__", (PyCFunction)_pickle_UnpicklerMemoProxy___reduce__, METH_NOARGS, _pickle_UnpicklerMemoProxy___reduce____doc__},
{"__reduce__", (PyCFunction)_pickle_UnpicklerMemoProxy___reduce__, METH_NOARGS, _pickle_UnpicklerMemoProxy___reduce____doc__},
static
PyObject
*
static
PyObject
*
_pickle_UnpicklerMemoProxy___reduce__
(
UnpicklerMemoProxyObject
*
self
)
_pickle_UnpicklerMemoProxy___reduce___impl
(
UnpicklerMemoProxyObject
*
self
);
/*[clinic checksum: ab5516a77659144e1191c7dd70a0c6c7455660bc]*/
static
PyObject
*
_pickle_UnpicklerMemoProxy___reduce__
(
PyObject
*
self
,
PyObject
*
Py_UNUSED
(
ignored
))
{
PyObject
*
return_value
=
NULL
;
return_value
=
_pickle_UnpicklerMemoProxy___reduce___impl
((
UnpicklerMemoProxyObject
*
)
self
);
return
return_value
;
}
static
PyObject
*
_pickle_UnpicklerMemoProxy___reduce___impl
(
UnpicklerMemoProxyObject
*
self
)
/*[clinic checksum: 4ee76a65511291f0de2e9e63db395d2e5d6d8df6]*/
{
{
PyObject
*
reduce_value
;
PyObject
*
reduce_value
;
PyObject
*
constructor_args
;
PyObject
*
constructor_args
;
PyObject
*
contents
=
_pickle_UnpicklerMemoProxy_copy
(
self
);
PyObject
*
contents
=
_pickle_UnpicklerMemoProxy_copy
_impl
(
self
);
if
(
contents
==
NULL
)
if
(
contents
==
NULL
)
return
NULL
;
return
NULL
;
...
...
Modules/zlibmodule.c
Dosyayı görüntüle @
3cceb384
...
@@ -1045,8 +1045,21 @@ PyDoc_STRVAR(zlib_Compress_copy__doc__,
...
@@ -1045,8 +1045,21 @@ PyDoc_STRVAR(zlib_Compress_copy__doc__,
{"copy", (PyCFunction)zlib_Compress_copy, METH_NOARGS, zlib_Compress_copy__doc__},
{"copy", (PyCFunction)zlib_Compress_copy, METH_NOARGS, zlib_Compress_copy__doc__},
static
PyObject
*
static
PyObject
*
zlib_Compress_copy
(
compobject
*
self
)
zlib_Compress_copy_impl
(
compobject
*
self
);
/*[clinic checksum: 0b37c07f8f27deb7d4769951fbecf600a1006ef8]*/
static
PyObject
*
zlib_Compress_copy
(
PyObject
*
self
,
PyObject
*
Py_UNUSED
(
ignored
))
{
PyObject
*
return_value
=
NULL
;
return_value
=
zlib_Compress_copy_impl
((
compobject
*
)
self
);
return
return_value
;
}
static
PyObject
*
zlib_Compress_copy_impl
(
compobject
*
self
)
/*[clinic checksum: 2f454ee15be3bc53cfb4e845c3f891f68be4c8e4]*/
{
{
compobject
*
retval
=
NULL
;
compobject
*
retval
=
NULL
;
int
err
;
int
err
;
...
...
Tools/clinic/clinic.py
Dosyayı görüntüle @
3cceb384
...
@@ -400,19 +400,13 @@ PyDoc_STRVAR({c_basename}__doc__,
...
@@ -400,19 +400,13 @@ PyDoc_STRVAR({c_basename}__doc__,
{{"{name}", (PyCFunction){c_basename}, {methoddef_flags}, {c_basename}__doc__}},
{{"{name}", (PyCFunction){c_basename}, {methoddef_flags}, {c_basename}__doc__}},
"""
.
replace
(
'{methoddef_flags}'
,
flags
)
"""
.
replace
(
'{methoddef_flags}'
,
flags
)
def
meth_noargs_pyobject_template
(
self
,
methoddef_flags
=
""
):
return
self
.
template_base
(
"METH_NOARGS"
,
methoddef_flags
)
+
"""
static PyObject *
{c_basename}({impl_parameters})
"""
def
meth_noargs_template
(
self
,
methoddef_flags
=
""
):
def
meth_noargs_template
(
self
,
methoddef_flags
=
""
):
return
self
.
template_base
(
"METH_NOARGS"
,
methoddef_flags
)
+
"""
return
self
.
template_base
(
"METH_NOARGS"
,
methoddef_flags
)
+
"""
static {impl_return_type}
static {impl_return_type}
{impl_prototype};
{impl_prototype};
static PyObject *
static PyObject *
{c_basename}({self_type}{self_name})
{c_basename}({self_type}{self_name}
, PyObject *Py_UNUSED(ignored)
)
{{
{{
PyObject *return_value = NULL;
PyObject *return_value = NULL;
{declarations}
{declarations}
...
@@ -713,10 +707,7 @@ static {impl_return_type}
...
@@ -713,10 +707,7 @@ static {impl_return_type}
f
.
return_converter
.
type
==
'PyObject *'
)
f
.
return_converter
.
type
==
'PyObject *'
)
if
not
parameters
:
if
not
parameters
:
if
default_return_converter
:
template
=
self
.
meth_noargs_template
(
f
.
methoddef_flags
)
template
=
self
.
meth_noargs_pyobject_template
(
f
.
methoddef_flags
)
else
:
template
=
self
.
meth_noargs_template
(
f
.
methoddef_flags
)
elif
(
len
(
parameters
)
==
1
and
elif
(
len
(
parameters
)
==
1
and
parameters
[
0
]
.
kind
==
inspect
.
Parameter
.
POSITIONAL_ONLY
and
parameters
[
0
]
.
kind
==
inspect
.
Parameter
.
POSITIONAL_ONLY
and
not
converters
[
0
]
.
is_optional
()
and
not
converters
[
0
]
.
is_optional
()
and
...
...
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