Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
de43e610
Commit
de43e610
authored
Jan 04, 2014
by
Larry Hastings
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #19976: Argument Clinic METH_NOARGS functions now always
take two parameters.
parent
bc2f2ea4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
150 additions
and
31 deletions
+150
-31
Include/pymacro.h
Include/pymacro.h
+6
-0
Misc/NEWS
Misc/NEWS
+5
-0
Modules/_pickle.c
Modules/_pickle.c
+122
-18
Modules/zlibmodule.c
Modules/zlibmodule.c
+15
-2
Tools/clinic/clinic.py
Tools/clinic/clinic.py
+2
-11
No files found.
Include/pymacro.h
View file @
de43e610
...
...
@@ -69,4 +69,10 @@
/* 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)))
#ifdef __GNUC__
#define Py_UNUSED(name) _unused_ ## name __attribute__((unused))
#else
#define Py_UNUSED(name) _unused_ ## name
#endif
#endif
/* Py_PYMACRO_H */
Misc/NEWS
View file @
de43e610
...
...
@@ -342,6 +342,11 @@ Documentation
-
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?
==================================
...
...
Modules/_pickle.c
View file @
de43e610
...
...
@@ -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__},
static
PyObject
*
_pickle_Pickler_clear_memo
(
PicklerObject
*
self
)
/*[clinic checksum: 9c32be7e7a17ff82a81aae409d0d4f469033a5b2]*/
_pickle_Pickler_clear_memo_impl
(
PicklerObject
*
self
);
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
)
PyMemoTable_Clear
(
self
->
memo
);
...
...
@@ -4176,8 +4189,21 @@ PyDoc_STRVAR(_pickle_PicklerMemoProxy_clear__doc__,
{"clear", (PyCFunction)_pickle_PicklerMemoProxy_clear, METH_NOARGS, _pickle_PicklerMemoProxy_clear__doc__},
static
PyObject
*
_pickle_PicklerMemoProxy_clear
(
PicklerMemoProxyObject
*
self
)
/*[clinic checksum: 507f13938721992e175a3e58b5ad02620045a1cc]*/
_pickle_PicklerMemoProxy_clear_impl
(
PicklerMemoProxyObject
*
self
);
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
)
PyMemoTable_Clear
(
self
->
pickler
->
memo
);
...
...
@@ -4200,8 +4226,21 @@ PyDoc_STRVAR(_pickle_PicklerMemoProxy_copy__doc__,
{"copy", (PyCFunction)_pickle_PicklerMemoProxy_copy, METH_NOARGS, _pickle_PicklerMemoProxy_copy__doc__},
static
PyObject
*
_pickle_PicklerMemoProxy_copy
(
PicklerMemoProxyObject
*
self
)
/*[clinic checksum: 73a5117ab354290ebdbe07bd0bf7232d0936a69d]*/
_pickle_PicklerMemoProxy_copy_impl
(
PicklerMemoProxyObject
*
self
);
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
;
PyMemoTable
*
memo
;
...
...
@@ -4254,11 +4293,24 @@ PyDoc_STRVAR(_pickle_PicklerMemoProxy___reduce____doc__,
{"__reduce__", (PyCFunction)_pickle_PicklerMemoProxy___reduce__, METH_NOARGS, _pickle_PicklerMemoProxy___reduce____doc__},
static
PyObject
*
_pickle_PicklerMemoProxy___reduce__
(
PicklerMemoProxyObject
*
self
)
/*[clinic checksum: 40f0bf7a9b161e77130674f0481bda0a0184dcce]*/
_pickle_PicklerMemoProxy___reduce___impl
(
PicklerMemoProxyObject
*
self
);
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
*
contents
=
_pickle_PicklerMemoProxy_copy
(
self
);
PyObject
*
contents
=
_pickle_PicklerMemoProxy_copy
_impl
(
self
);
if
(
contents
==
NULL
)
return
NULL
;
...
...
@@ -6288,8 +6340,21 @@ PyDoc_STRVAR(_pickle_Unpickler_load__doc__,
{"load", (PyCFunction)_pickle_Unpickler_load, METH_NOARGS, _pickle_Unpickler_load__doc__},
static
PyObject
*
_pickle_Unpickler_load
(
PyObject
*
self
)
/*[clinic checksum: c2ae1263f0dd000f34ccf0fe59d7c544464babc4]*/
_pickle_Unpickler_load_impl
(
PyObject
*
self
);
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
;
...
...
@@ -6688,8 +6753,21 @@ PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_clear__doc__,
{"clear", (PyCFunction)_pickle_UnpicklerMemoProxy_clear, METH_NOARGS, _pickle_UnpicklerMemoProxy_clear__doc__},
static
PyObject
*
_pickle_UnpicklerMemoProxy_clear
(
UnpicklerMemoProxyObject
*
self
)
/*[clinic checksum: 46fecf4e33c0c873124f845edf6cc3a2e9864bd5]*/
_pickle_UnpicklerMemoProxy_clear_impl
(
UnpicklerMemoProxyObject
*
self
);
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
);
self
->
unpickler
->
memo
=
_Unpickler_NewMemo
(
self
->
unpickler
->
memo_size
);
...
...
@@ -6714,8 +6792,21 @@ PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_copy__doc__,
{"copy", (PyCFunction)_pickle_UnpicklerMemoProxy_copy, METH_NOARGS, _pickle_UnpicklerMemoProxy_copy__doc__},
static
PyObject
*
_pickle_UnpicklerMemoProxy_copy
(
UnpicklerMemoProxyObject
*
self
)
/*[clinic checksum: f8856c4e8a33540886dfbb245f286af3008fa0ad]*/
_pickle_UnpicklerMemoProxy_copy_impl
(
UnpicklerMemoProxyObject
*
self
);
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
;
PyObject
*
new_memo
=
PyDict_New
();
...
...
@@ -6761,12 +6852,25 @@ PyDoc_STRVAR(_pickle_UnpicklerMemoProxy___reduce____doc__,
{"__reduce__", (PyCFunction)_pickle_UnpicklerMemoProxy___reduce__, METH_NOARGS, _pickle_UnpicklerMemoProxy___reduce____doc__},
static
PyObject
*
_pickle_UnpicklerMemoProxy___reduce__
(
UnpicklerMemoProxyObject
*
self
)
/*[clinic checksum: ab5516a77659144e1191c7dd70a0c6c7455660bc]*/
_pickle_UnpicklerMemoProxy___reduce___impl
(
UnpicklerMemoProxyObject
*
self
);
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
*
constructor_args
;
PyObject
*
contents
=
_pickle_UnpicklerMemoProxy_copy
(
self
);
PyObject
*
contents
=
_pickle_UnpicklerMemoProxy_copy
_impl
(
self
);
if
(
contents
==
NULL
)
return
NULL
;
...
...
Modules/zlibmodule.c
View file @
de43e610
...
...
@@ -1045,8 +1045,21 @@ PyDoc_STRVAR(zlib_Compress_copy__doc__,
{"copy", (PyCFunction)zlib_Compress_copy, METH_NOARGS, zlib_Compress_copy__doc__},
static
PyObject
*
zlib_Compress_copy
(
compobject
*
self
)
/*[clinic checksum: 0b37c07f8f27deb7d4769951fbecf600a1006ef8]*/
zlib_Compress_copy_impl
(
compobject
*
self
);
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
;
int
err
;
...
...
Tools/clinic/clinic.py
View file @
de43e610
...
...
@@ -400,19 +400,13 @@ PyDoc_STRVAR({c_basename}__doc__,
{{"{name}", (PyCFunction){c_basename}, {methoddef_flags}, {c_basename}__doc__}},
"""
.
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
=
""
):
return
self
.
template_base
(
"METH_NOARGS"
,
methoddef_flags
)
+
"""
static {impl_return_type}
{impl_prototype};
static PyObject *
{c_basename}({self_type}{self_name})
{c_basename}({self_type}{self_name}
, PyObject *Py_UNUSED(ignored)
)
{{
PyObject *return_value = NULL;
{declarations}
...
...
@@ -713,10 +707,7 @@ static {impl_return_type}
f
.
return_converter
.
type
==
'PyObject *'
)
if
not
parameters
:
if
default_return_converter
:
template
=
self
.
meth_noargs_pyobject_template
(
f
.
methoddef_flags
)
else
:
template
=
self
.
meth_noargs_template
(
f
.
methoddef_flags
)
template
=
self
.
meth_noargs_template
(
f
.
methoddef_flags
)
elif
(
len
(
parameters
)
==
1
and
parameters
[
0
].
kind
==
inspect
.
Parameter
.
POSITIONAL_ONLY
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