Issue #23492: Argument Clinic now generates argument parsing code with

PyArg_Parse instead of PyArg_ParseTuple if possible.
This commit is contained in:
Serhiy Storchaka 2015-04-04 00:12:11 +03:00
parent 1009bf18b3
commit 92e8af67a8
17 changed files with 320 additions and 302 deletions

View File

@ -63,7 +63,7 @@ Library
Build Build
----- -----
- Issue #23501: Argumen Clinic now generates code into separate files by default. - Issue #23501: Argument Clinic now generates code into separate files by default.
Tests Tests
----- -----
@ -71,6 +71,13 @@ Tests
Tools/Demos Tools/Demos
----------- -----------
- Issue #23492: Argument Clinic now generates argument parsing code with
PyArg_Parse instead of PyArg_ParseTuple if possible.
- Issue #23500: Argument Clinic is now smarter about generating the "#ifndef"
(empty) definition of the methoddef macro: it's only generated once, even
if Argument Clinic processes the same symbol multiple times, and it's emitted
at the end of all processing rather than immediately after the first use.
What's New in Python 3.5.0 alpha 3? What's New in Python 3.5.0 alpha 3?
@ -270,11 +277,6 @@ Tests
Tools/Demos Tools/Demos
----------- -----------
- Issue #23500: Argument Clinic is now smarter about generating the "#ifndef"
(empty) definition of the methoddef macro: it's only generated once, even
if Argument Clinic processes the same symbol multiple times, and it's emitted
at the end of all processing rather than immediately after the first use.
- Issue #22826: The result of open() in Tools/freeze/bkfile.py is now better - Issue #22826: The result of open() in Tools/freeze/bkfile.py is now better
compatible with regular files (in particular it now supports the context compatible with regular files (in particular it now supports the context
management protocol). management protocol).

View File

@ -14,18 +14,18 @@ PyDoc_STRVAR(_bz2_BZ2Compressor_compress__doc__,
"flush() method to finish the compression process."); "flush() method to finish the compression process.");
#define _BZ2_BZ2COMPRESSOR_COMPRESS_METHODDEF \ #define _BZ2_BZ2COMPRESSOR_COMPRESS_METHODDEF \
{"compress", (PyCFunction)_bz2_BZ2Compressor_compress, METH_VARARGS, _bz2_BZ2Compressor_compress__doc__}, {"compress", (PyCFunction)_bz2_BZ2Compressor_compress, METH_O, _bz2_BZ2Compressor_compress__doc__},
static PyObject * static PyObject *
_bz2_BZ2Compressor_compress_impl(BZ2Compressor *self, Py_buffer *data); _bz2_BZ2Compressor_compress_impl(BZ2Compressor *self, Py_buffer *data);
static PyObject * static PyObject *
_bz2_BZ2Compressor_compress(BZ2Compressor *self, PyObject *args) _bz2_BZ2Compressor_compress(BZ2Compressor *self, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL}; Py_buffer data = {NULL, NULL};
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"y*:compress", "y*:compress",
&data)) &data))
goto exit; goto exit;
@ -168,4 +168,4 @@ _bz2_BZ2Decompressor___init__(PyObject *self, PyObject *args, PyObject *kwargs)
exit: exit:
return return_value; return return_value;
} }
/*[clinic end generated code: output=8e65e3953430bc3d input=a9049054013a1b77]*/ /*[clinic end generated code: output=3565d163a360af01 input=a9049054013a1b77]*/

View File

@ -9,18 +9,18 @@ PyDoc_STRVAR(_codecs__forget_codec__doc__,
"Purge the named codec from the internal codec lookup cache"); "Purge the named codec from the internal codec lookup cache");
#define _CODECS__FORGET_CODEC_METHODDEF \ #define _CODECS__FORGET_CODEC_METHODDEF \
{"_forget_codec", (PyCFunction)_codecs__forget_codec, METH_VARARGS, _codecs__forget_codec__doc__}, {"_forget_codec", (PyCFunction)_codecs__forget_codec, METH_O, _codecs__forget_codec__doc__},
static PyObject * static PyObject *
_codecs__forget_codec_impl(PyModuleDef *module, const char *encoding); _codecs__forget_codec_impl(PyModuleDef *module, const char *encoding);
static PyObject * static PyObject *
_codecs__forget_codec(PyModuleDef *module, PyObject *args) _codecs__forget_codec(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
const char *encoding; const char *encoding;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"s:_forget_codec", "s:_forget_codec",
&encoding)) &encoding))
goto exit; goto exit;
@ -29,4 +29,4 @@ _codecs__forget_codec(PyModuleDef *module, PyObject *args)
exit: exit:
return return_value; return return_value;
} }
/*[clinic end generated code: output=cdea83e21d76a900 input=a9049054013a1b77]*/ /*[clinic end generated code: output=fc5ce4d3166f7d96 input=a9049054013a1b77]*/

View File

@ -14,18 +14,18 @@ PyDoc_STRVAR(_lzma_LZMACompressor_compress__doc__,
"flush() method to finish the compression process."); "flush() method to finish the compression process.");
#define _LZMA_LZMACOMPRESSOR_COMPRESS_METHODDEF \ #define _LZMA_LZMACOMPRESSOR_COMPRESS_METHODDEF \
{"compress", (PyCFunction)_lzma_LZMACompressor_compress, METH_VARARGS, _lzma_LZMACompressor_compress__doc__}, {"compress", (PyCFunction)_lzma_LZMACompressor_compress, METH_O, _lzma_LZMACompressor_compress__doc__},
static PyObject * static PyObject *
_lzma_LZMACompressor_compress_impl(Compressor *self, Py_buffer *data); _lzma_LZMACompressor_compress_impl(Compressor *self, Py_buffer *data);
static PyObject * static PyObject *
_lzma_LZMACompressor_compress(Compressor *self, PyObject *args) _lzma_LZMACompressor_compress(Compressor *self, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL}; Py_buffer data = {NULL, NULL};
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"y*:compress", "y*:compress",
&data)) &data))
goto exit; goto exit;
@ -162,18 +162,18 @@ PyDoc_STRVAR(_lzma_is_check_supported__doc__,
"Always returns True for CHECK_NONE and CHECK_CRC32."); "Always returns True for CHECK_NONE and CHECK_CRC32.");
#define _LZMA_IS_CHECK_SUPPORTED_METHODDEF \ #define _LZMA_IS_CHECK_SUPPORTED_METHODDEF \
{"is_check_supported", (PyCFunction)_lzma_is_check_supported, METH_VARARGS, _lzma_is_check_supported__doc__}, {"is_check_supported", (PyCFunction)_lzma_is_check_supported, METH_O, _lzma_is_check_supported__doc__},
static PyObject * static PyObject *
_lzma_is_check_supported_impl(PyModuleDef *module, int check_id); _lzma_is_check_supported_impl(PyModuleDef *module, int check_id);
static PyObject * static PyObject *
_lzma_is_check_supported(PyModuleDef *module, PyObject *args) _lzma_is_check_supported(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
int check_id; int check_id;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"i:is_check_supported", "i:is_check_supported",
&check_id)) &check_id))
goto exit; goto exit;
@ -192,18 +192,18 @@ PyDoc_STRVAR(_lzma__encode_filter_properties__doc__,
"The result does not include the filter ID itself, only the options."); "The result does not include the filter ID itself, only the options.");
#define _LZMA__ENCODE_FILTER_PROPERTIES_METHODDEF \ #define _LZMA__ENCODE_FILTER_PROPERTIES_METHODDEF \
{"_encode_filter_properties", (PyCFunction)_lzma__encode_filter_properties, METH_VARARGS, _lzma__encode_filter_properties__doc__}, {"_encode_filter_properties", (PyCFunction)_lzma__encode_filter_properties, METH_O, _lzma__encode_filter_properties__doc__},
static PyObject * static PyObject *
_lzma__encode_filter_properties_impl(PyModuleDef *module, lzma_filter filter); _lzma__encode_filter_properties_impl(PyModuleDef *module, lzma_filter filter);
static PyObject * static PyObject *
_lzma__encode_filter_properties(PyModuleDef *module, PyObject *args) _lzma__encode_filter_properties(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
lzma_filter filter = {LZMA_VLI_UNKNOWN, NULL}; lzma_filter filter = {LZMA_VLI_UNKNOWN, NULL};
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"O&:_encode_filter_properties", "O&:_encode_filter_properties",
lzma_filter_converter, &filter)) lzma_filter_converter, &filter))
goto exit; goto exit;
@ -251,4 +251,4 @@ exit:
return return_value; return return_value;
} }
/*[clinic end generated code: output=dc42b73890609369 input=a9049054013a1b77]*/ /*[clinic end generated code: output=ea7f2b2c4019fe86 input=a9049054013a1b77]*/

View File

@ -267,18 +267,18 @@ PyDoc_STRVAR(array_array_fromstring__doc__,
"This method is deprecated. Use frombytes instead."); "This method is deprecated. Use frombytes instead.");
#define ARRAY_ARRAY_FROMSTRING_METHODDEF \ #define ARRAY_ARRAY_FROMSTRING_METHODDEF \
{"fromstring", (PyCFunction)array_array_fromstring, METH_VARARGS, array_array_fromstring__doc__}, {"fromstring", (PyCFunction)array_array_fromstring, METH_O, array_array_fromstring__doc__},
static PyObject * static PyObject *
array_array_fromstring_impl(arrayobject *self, Py_buffer *buffer); array_array_fromstring_impl(arrayobject *self, Py_buffer *buffer);
static PyObject * static PyObject *
array_array_fromstring(arrayobject *self, PyObject *args) array_array_fromstring(arrayobject *self, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_buffer buffer = {NULL, NULL}; Py_buffer buffer = {NULL, NULL};
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"s*:fromstring", "s*:fromstring",
&buffer)) &buffer))
goto exit; goto exit;
@ -299,18 +299,18 @@ PyDoc_STRVAR(array_array_frombytes__doc__,
"Appends items from the string, interpreting it as an array of machine values, as if it had been read from a file using the fromfile() method)."); "Appends items from the string, interpreting it as an array of machine values, as if it had been read from a file using the fromfile() method).");
#define ARRAY_ARRAY_FROMBYTES_METHODDEF \ #define ARRAY_ARRAY_FROMBYTES_METHODDEF \
{"frombytes", (PyCFunction)array_array_frombytes, METH_VARARGS, array_array_frombytes__doc__}, {"frombytes", (PyCFunction)array_array_frombytes, METH_O, array_array_frombytes__doc__},
static PyObject * static PyObject *
array_array_frombytes_impl(arrayobject *self, Py_buffer *buffer); array_array_frombytes_impl(arrayobject *self, Py_buffer *buffer);
static PyObject * static PyObject *
array_array_frombytes(arrayobject *self, PyObject *args) array_array_frombytes(arrayobject *self, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_buffer buffer = {NULL, NULL}; Py_buffer buffer = {NULL, NULL};
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"y*:frombytes", "y*:frombytes",
&buffer)) &buffer))
goto exit; goto exit;
@ -373,19 +373,19 @@ PyDoc_STRVAR(array_array_fromunicode__doc__,
"some other type."); "some other type.");
#define ARRAY_ARRAY_FROMUNICODE_METHODDEF \ #define ARRAY_ARRAY_FROMUNICODE_METHODDEF \
{"fromunicode", (PyCFunction)array_array_fromunicode, METH_VARARGS, array_array_fromunicode__doc__}, {"fromunicode", (PyCFunction)array_array_fromunicode, METH_O, array_array_fromunicode__doc__},
static PyObject * static PyObject *
array_array_fromunicode_impl(arrayobject *self, Py_UNICODE *ustr, Py_ssize_clean_t ustr_length); array_array_fromunicode_impl(arrayobject *self, Py_UNICODE *ustr, Py_ssize_clean_t ustr_length);
static PyObject * static PyObject *
array_array_fromunicode(arrayobject *self, PyObject *args) array_array_fromunicode(arrayobject *self, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_UNICODE *ustr; Py_UNICODE *ustr;
Py_ssize_clean_t ustr_length; Py_ssize_clean_t ustr_length;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"u#:fromunicode", "u#:fromunicode",
&ustr, &ustr_length)) &ustr, &ustr_length))
goto exit; goto exit;
@ -502,4 +502,4 @@ PyDoc_STRVAR(array_arrayiterator___setstate____doc__,
#define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \ #define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \
{"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__}, {"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__},
/*[clinic end generated code: output=e1deb61c6a3bc8c8 input=a9049054013a1b77]*/ /*[clinic end generated code: output=a8fbe83c2026fa83 input=a9049054013a1b77]*/

View File

@ -9,18 +9,18 @@ PyDoc_STRVAR(binascii_a2b_uu__doc__,
"Decode a line of uuencoded data."); "Decode a line of uuencoded data.");
#define BINASCII_A2B_UU_METHODDEF \ #define BINASCII_A2B_UU_METHODDEF \
{"a2b_uu", (PyCFunction)binascii_a2b_uu, METH_VARARGS, binascii_a2b_uu__doc__}, {"a2b_uu", (PyCFunction)binascii_a2b_uu, METH_O, binascii_a2b_uu__doc__},
static PyObject * static PyObject *
binascii_a2b_uu_impl(PyModuleDef *module, Py_buffer *data); binascii_a2b_uu_impl(PyModuleDef *module, Py_buffer *data);
static PyObject * static PyObject *
binascii_a2b_uu(PyModuleDef *module, PyObject *args) binascii_a2b_uu(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL}; Py_buffer data = {NULL, NULL};
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"O&:a2b_uu", "O&:a2b_uu",
ascii_buffer_converter, &data)) ascii_buffer_converter, &data))
goto exit; goto exit;
@ -41,18 +41,18 @@ PyDoc_STRVAR(binascii_b2a_uu__doc__,
"Uuencode line of data."); "Uuencode line of data.");
#define BINASCII_B2A_UU_METHODDEF \ #define BINASCII_B2A_UU_METHODDEF \
{"b2a_uu", (PyCFunction)binascii_b2a_uu, METH_VARARGS, binascii_b2a_uu__doc__}, {"b2a_uu", (PyCFunction)binascii_b2a_uu, METH_O, binascii_b2a_uu__doc__},
static PyObject * static PyObject *
binascii_b2a_uu_impl(PyModuleDef *module, Py_buffer *data); binascii_b2a_uu_impl(PyModuleDef *module, Py_buffer *data);
static PyObject * static PyObject *
binascii_b2a_uu(PyModuleDef *module, PyObject *args) binascii_b2a_uu(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL}; Py_buffer data = {NULL, NULL};
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"y*:b2a_uu", "y*:b2a_uu",
&data)) &data))
goto exit; goto exit;
@ -73,18 +73,18 @@ PyDoc_STRVAR(binascii_a2b_base64__doc__,
"Decode a line of base64 data."); "Decode a line of base64 data.");
#define BINASCII_A2B_BASE64_METHODDEF \ #define BINASCII_A2B_BASE64_METHODDEF \
{"a2b_base64", (PyCFunction)binascii_a2b_base64, METH_VARARGS, binascii_a2b_base64__doc__}, {"a2b_base64", (PyCFunction)binascii_a2b_base64, METH_O, binascii_a2b_base64__doc__},
static PyObject * static PyObject *
binascii_a2b_base64_impl(PyModuleDef *module, Py_buffer *data); binascii_a2b_base64_impl(PyModuleDef *module, Py_buffer *data);
static PyObject * static PyObject *
binascii_a2b_base64(PyModuleDef *module, PyObject *args) binascii_a2b_base64(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL}; Py_buffer data = {NULL, NULL};
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"O&:a2b_base64", "O&:a2b_base64",
ascii_buffer_converter, &data)) ascii_buffer_converter, &data))
goto exit; goto exit;
@ -105,18 +105,18 @@ PyDoc_STRVAR(binascii_b2a_base64__doc__,
"Base64-code line of data."); "Base64-code line of data.");
#define BINASCII_B2A_BASE64_METHODDEF \ #define BINASCII_B2A_BASE64_METHODDEF \
{"b2a_base64", (PyCFunction)binascii_b2a_base64, METH_VARARGS, binascii_b2a_base64__doc__}, {"b2a_base64", (PyCFunction)binascii_b2a_base64, METH_O, binascii_b2a_base64__doc__},
static PyObject * static PyObject *
binascii_b2a_base64_impl(PyModuleDef *module, Py_buffer *data); binascii_b2a_base64_impl(PyModuleDef *module, Py_buffer *data);
static PyObject * static PyObject *
binascii_b2a_base64(PyModuleDef *module, PyObject *args) binascii_b2a_base64(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL}; Py_buffer data = {NULL, NULL};
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"y*:b2a_base64", "y*:b2a_base64",
&data)) &data))
goto exit; goto exit;
@ -137,18 +137,18 @@ PyDoc_STRVAR(binascii_a2b_hqx__doc__,
"Decode .hqx coding."); "Decode .hqx coding.");
#define BINASCII_A2B_HQX_METHODDEF \ #define BINASCII_A2B_HQX_METHODDEF \
{"a2b_hqx", (PyCFunction)binascii_a2b_hqx, METH_VARARGS, binascii_a2b_hqx__doc__}, {"a2b_hqx", (PyCFunction)binascii_a2b_hqx, METH_O, binascii_a2b_hqx__doc__},
static PyObject * static PyObject *
binascii_a2b_hqx_impl(PyModuleDef *module, Py_buffer *data); binascii_a2b_hqx_impl(PyModuleDef *module, Py_buffer *data);
static PyObject * static PyObject *
binascii_a2b_hqx(PyModuleDef *module, PyObject *args) binascii_a2b_hqx(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL}; Py_buffer data = {NULL, NULL};
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"O&:a2b_hqx", "O&:a2b_hqx",
ascii_buffer_converter, &data)) ascii_buffer_converter, &data))
goto exit; goto exit;
@ -169,18 +169,18 @@ PyDoc_STRVAR(binascii_rlecode_hqx__doc__,
"Binhex RLE-code binary data."); "Binhex RLE-code binary data.");
#define BINASCII_RLECODE_HQX_METHODDEF \ #define BINASCII_RLECODE_HQX_METHODDEF \
{"rlecode_hqx", (PyCFunction)binascii_rlecode_hqx, METH_VARARGS, binascii_rlecode_hqx__doc__}, {"rlecode_hqx", (PyCFunction)binascii_rlecode_hqx, METH_O, binascii_rlecode_hqx__doc__},
static PyObject * static PyObject *
binascii_rlecode_hqx_impl(PyModuleDef *module, Py_buffer *data); binascii_rlecode_hqx_impl(PyModuleDef *module, Py_buffer *data);
static PyObject * static PyObject *
binascii_rlecode_hqx(PyModuleDef *module, PyObject *args) binascii_rlecode_hqx(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL}; Py_buffer data = {NULL, NULL};
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"y*:rlecode_hqx", "y*:rlecode_hqx",
&data)) &data))
goto exit; goto exit;
@ -201,18 +201,18 @@ PyDoc_STRVAR(binascii_b2a_hqx__doc__,
"Encode .hqx data."); "Encode .hqx data.");
#define BINASCII_B2A_HQX_METHODDEF \ #define BINASCII_B2A_HQX_METHODDEF \
{"b2a_hqx", (PyCFunction)binascii_b2a_hqx, METH_VARARGS, binascii_b2a_hqx__doc__}, {"b2a_hqx", (PyCFunction)binascii_b2a_hqx, METH_O, binascii_b2a_hqx__doc__},
static PyObject * static PyObject *
binascii_b2a_hqx_impl(PyModuleDef *module, Py_buffer *data); binascii_b2a_hqx_impl(PyModuleDef *module, Py_buffer *data);
static PyObject * static PyObject *
binascii_b2a_hqx(PyModuleDef *module, PyObject *args) binascii_b2a_hqx(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL}; Py_buffer data = {NULL, NULL};
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"y*:b2a_hqx", "y*:b2a_hqx",
&data)) &data))
goto exit; goto exit;
@ -233,18 +233,18 @@ PyDoc_STRVAR(binascii_rledecode_hqx__doc__,
"Decode hexbin RLE-coded string."); "Decode hexbin RLE-coded string.");
#define BINASCII_RLEDECODE_HQX_METHODDEF \ #define BINASCII_RLEDECODE_HQX_METHODDEF \
{"rledecode_hqx", (PyCFunction)binascii_rledecode_hqx, METH_VARARGS, binascii_rledecode_hqx__doc__}, {"rledecode_hqx", (PyCFunction)binascii_rledecode_hqx, METH_O, binascii_rledecode_hqx__doc__},
static PyObject * static PyObject *
binascii_rledecode_hqx_impl(PyModuleDef *module, Py_buffer *data); binascii_rledecode_hqx_impl(PyModuleDef *module, Py_buffer *data);
static PyObject * static PyObject *
binascii_rledecode_hqx(PyModuleDef *module, PyObject *args) binascii_rledecode_hqx(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL}; Py_buffer data = {NULL, NULL};
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"y*:rledecode_hqx", "y*:rledecode_hqx",
&data)) &data))
goto exit; goto exit;
@ -342,18 +342,18 @@ PyDoc_STRVAR(binascii_b2a_hex__doc__,
"available as \"hexlify()\"."); "available as \"hexlify()\".");
#define BINASCII_B2A_HEX_METHODDEF \ #define BINASCII_B2A_HEX_METHODDEF \
{"b2a_hex", (PyCFunction)binascii_b2a_hex, METH_VARARGS, binascii_b2a_hex__doc__}, {"b2a_hex", (PyCFunction)binascii_b2a_hex, METH_O, binascii_b2a_hex__doc__},
static PyObject * static PyObject *
binascii_b2a_hex_impl(PyModuleDef *module, Py_buffer *data); binascii_b2a_hex_impl(PyModuleDef *module, Py_buffer *data);
static PyObject * static PyObject *
binascii_b2a_hex(PyModuleDef *module, PyObject *args) binascii_b2a_hex(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL}; Py_buffer data = {NULL, NULL};
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"y*:b2a_hex", "y*:b2a_hex",
&data)) &data))
goto exit; goto exit;
@ -376,18 +376,18 @@ PyDoc_STRVAR(binascii_hexlify__doc__,
"The return value is a bytes object."); "The return value is a bytes object.");
#define BINASCII_HEXLIFY_METHODDEF \ #define BINASCII_HEXLIFY_METHODDEF \
{"hexlify", (PyCFunction)binascii_hexlify, METH_VARARGS, binascii_hexlify__doc__}, {"hexlify", (PyCFunction)binascii_hexlify, METH_O, binascii_hexlify__doc__},
static PyObject * static PyObject *
binascii_hexlify_impl(PyModuleDef *module, Py_buffer *data); binascii_hexlify_impl(PyModuleDef *module, Py_buffer *data);
static PyObject * static PyObject *
binascii_hexlify(PyModuleDef *module, PyObject *args) binascii_hexlify(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL}; Py_buffer data = {NULL, NULL};
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"y*:hexlify", "y*:hexlify",
&data)) &data))
goto exit; goto exit;
@ -411,18 +411,18 @@ PyDoc_STRVAR(binascii_a2b_hex__doc__,
"This function is also available as \"unhexlify()\"."); "This function is also available as \"unhexlify()\".");
#define BINASCII_A2B_HEX_METHODDEF \ #define BINASCII_A2B_HEX_METHODDEF \
{"a2b_hex", (PyCFunction)binascii_a2b_hex, METH_VARARGS, binascii_a2b_hex__doc__}, {"a2b_hex", (PyCFunction)binascii_a2b_hex, METH_O, binascii_a2b_hex__doc__},
static PyObject * static PyObject *
binascii_a2b_hex_impl(PyModuleDef *module, Py_buffer *hexstr); binascii_a2b_hex_impl(PyModuleDef *module, Py_buffer *hexstr);
static PyObject * static PyObject *
binascii_a2b_hex(PyModuleDef *module, PyObject *args) binascii_a2b_hex(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_buffer hexstr = {NULL, NULL}; Py_buffer hexstr = {NULL, NULL};
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"O&:a2b_hex", "O&:a2b_hex",
ascii_buffer_converter, &hexstr)) ascii_buffer_converter, &hexstr))
goto exit; goto exit;
@ -445,18 +445,18 @@ PyDoc_STRVAR(binascii_unhexlify__doc__,
"hexstr must contain an even number of hex digits (upper or lower case)."); "hexstr must contain an even number of hex digits (upper or lower case).");
#define BINASCII_UNHEXLIFY_METHODDEF \ #define BINASCII_UNHEXLIFY_METHODDEF \
{"unhexlify", (PyCFunction)binascii_unhexlify, METH_VARARGS, binascii_unhexlify__doc__}, {"unhexlify", (PyCFunction)binascii_unhexlify, METH_O, binascii_unhexlify__doc__},
static PyObject * static PyObject *
binascii_unhexlify_impl(PyModuleDef *module, Py_buffer *hexstr); binascii_unhexlify_impl(PyModuleDef *module, Py_buffer *hexstr);
static PyObject * static PyObject *
binascii_unhexlify(PyModuleDef *module, PyObject *args) binascii_unhexlify(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_buffer hexstr = {NULL, NULL}; Py_buffer hexstr = {NULL, NULL};
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"O&:unhexlify", "O&:unhexlify",
ascii_buffer_converter, &hexstr)) ascii_buffer_converter, &hexstr))
goto exit; goto exit;
@ -543,4 +543,4 @@ exit:
return return_value; return return_value;
} }
/*[clinic end generated code: output=771126f8f53e84e7 input=a9049054013a1b77]*/ /*[clinic end generated code: output=31ccbd5fddc8fd75 input=a9049054013a1b77]*/

View File

@ -9,19 +9,19 @@ PyDoc_STRVAR(cmath_acos__doc__,
"Return the arc cosine of z."); "Return the arc cosine of z.");
#define CMATH_ACOS_METHODDEF \ #define CMATH_ACOS_METHODDEF \
{"acos", (PyCFunction)cmath_acos, METH_VARARGS, cmath_acos__doc__}, {"acos", (PyCFunction)cmath_acos, METH_O, cmath_acos__doc__},
static Py_complex static Py_complex
cmath_acos_impl(PyModuleDef *module, Py_complex z); cmath_acos_impl(PyModuleDef *module, Py_complex z);
static PyObject * static PyObject *
cmath_acos(PyModuleDef *module, PyObject *args) cmath_acos(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_complex z; Py_complex z;
Py_complex _return_value; Py_complex _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"D:acos", "D:acos",
&z)) &z))
goto exit; goto exit;
@ -52,19 +52,19 @@ PyDoc_STRVAR(cmath_acosh__doc__,
"Return the inverse hyperbolic cosine of z."); "Return the inverse hyperbolic cosine of z.");
#define CMATH_ACOSH_METHODDEF \ #define CMATH_ACOSH_METHODDEF \
{"acosh", (PyCFunction)cmath_acosh, METH_VARARGS, cmath_acosh__doc__}, {"acosh", (PyCFunction)cmath_acosh, METH_O, cmath_acosh__doc__},
static Py_complex static Py_complex
cmath_acosh_impl(PyModuleDef *module, Py_complex z); cmath_acosh_impl(PyModuleDef *module, Py_complex z);
static PyObject * static PyObject *
cmath_acosh(PyModuleDef *module, PyObject *args) cmath_acosh(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_complex z; Py_complex z;
Py_complex _return_value; Py_complex _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"D:acosh", "D:acosh",
&z)) &z))
goto exit; goto exit;
@ -95,19 +95,19 @@ PyDoc_STRVAR(cmath_asin__doc__,
"Return the arc sine of z."); "Return the arc sine of z.");
#define CMATH_ASIN_METHODDEF \ #define CMATH_ASIN_METHODDEF \
{"asin", (PyCFunction)cmath_asin, METH_VARARGS, cmath_asin__doc__}, {"asin", (PyCFunction)cmath_asin, METH_O, cmath_asin__doc__},
static Py_complex static Py_complex
cmath_asin_impl(PyModuleDef *module, Py_complex z); cmath_asin_impl(PyModuleDef *module, Py_complex z);
static PyObject * static PyObject *
cmath_asin(PyModuleDef *module, PyObject *args) cmath_asin(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_complex z; Py_complex z;
Py_complex _return_value; Py_complex _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"D:asin", "D:asin",
&z)) &z))
goto exit; goto exit;
@ -138,19 +138,19 @@ PyDoc_STRVAR(cmath_asinh__doc__,
"Return the inverse hyperbolic sine of z."); "Return the inverse hyperbolic sine of z.");
#define CMATH_ASINH_METHODDEF \ #define CMATH_ASINH_METHODDEF \
{"asinh", (PyCFunction)cmath_asinh, METH_VARARGS, cmath_asinh__doc__}, {"asinh", (PyCFunction)cmath_asinh, METH_O, cmath_asinh__doc__},
static Py_complex static Py_complex
cmath_asinh_impl(PyModuleDef *module, Py_complex z); cmath_asinh_impl(PyModuleDef *module, Py_complex z);
static PyObject * static PyObject *
cmath_asinh(PyModuleDef *module, PyObject *args) cmath_asinh(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_complex z; Py_complex z;
Py_complex _return_value; Py_complex _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"D:asinh", "D:asinh",
&z)) &z))
goto exit; goto exit;
@ -181,19 +181,19 @@ PyDoc_STRVAR(cmath_atan__doc__,
"Return the arc tangent of z."); "Return the arc tangent of z.");
#define CMATH_ATAN_METHODDEF \ #define CMATH_ATAN_METHODDEF \
{"atan", (PyCFunction)cmath_atan, METH_VARARGS, cmath_atan__doc__}, {"atan", (PyCFunction)cmath_atan, METH_O, cmath_atan__doc__},
static Py_complex static Py_complex
cmath_atan_impl(PyModuleDef *module, Py_complex z); cmath_atan_impl(PyModuleDef *module, Py_complex z);
static PyObject * static PyObject *
cmath_atan(PyModuleDef *module, PyObject *args) cmath_atan(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_complex z; Py_complex z;
Py_complex _return_value; Py_complex _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"D:atan", "D:atan",
&z)) &z))
goto exit; goto exit;
@ -224,19 +224,19 @@ PyDoc_STRVAR(cmath_atanh__doc__,
"Return the inverse hyperbolic tangent of z."); "Return the inverse hyperbolic tangent of z.");
#define CMATH_ATANH_METHODDEF \ #define CMATH_ATANH_METHODDEF \
{"atanh", (PyCFunction)cmath_atanh, METH_VARARGS, cmath_atanh__doc__}, {"atanh", (PyCFunction)cmath_atanh, METH_O, cmath_atanh__doc__},
static Py_complex static Py_complex
cmath_atanh_impl(PyModuleDef *module, Py_complex z); cmath_atanh_impl(PyModuleDef *module, Py_complex z);
static PyObject * static PyObject *
cmath_atanh(PyModuleDef *module, PyObject *args) cmath_atanh(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_complex z; Py_complex z;
Py_complex _return_value; Py_complex _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"D:atanh", "D:atanh",
&z)) &z))
goto exit; goto exit;
@ -267,19 +267,19 @@ PyDoc_STRVAR(cmath_cos__doc__,
"Return the cosine of z."); "Return the cosine of z.");
#define CMATH_COS_METHODDEF \ #define CMATH_COS_METHODDEF \
{"cos", (PyCFunction)cmath_cos, METH_VARARGS, cmath_cos__doc__}, {"cos", (PyCFunction)cmath_cos, METH_O, cmath_cos__doc__},
static Py_complex static Py_complex
cmath_cos_impl(PyModuleDef *module, Py_complex z); cmath_cos_impl(PyModuleDef *module, Py_complex z);
static PyObject * static PyObject *
cmath_cos(PyModuleDef *module, PyObject *args) cmath_cos(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_complex z; Py_complex z;
Py_complex _return_value; Py_complex _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"D:cos", "D:cos",
&z)) &z))
goto exit; goto exit;
@ -310,19 +310,19 @@ PyDoc_STRVAR(cmath_cosh__doc__,
"Return the hyperbolic cosine of z."); "Return the hyperbolic cosine of z.");
#define CMATH_COSH_METHODDEF \ #define CMATH_COSH_METHODDEF \
{"cosh", (PyCFunction)cmath_cosh, METH_VARARGS, cmath_cosh__doc__}, {"cosh", (PyCFunction)cmath_cosh, METH_O, cmath_cosh__doc__},
static Py_complex static Py_complex
cmath_cosh_impl(PyModuleDef *module, Py_complex z); cmath_cosh_impl(PyModuleDef *module, Py_complex z);
static PyObject * static PyObject *
cmath_cosh(PyModuleDef *module, PyObject *args) cmath_cosh(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_complex z; Py_complex z;
Py_complex _return_value; Py_complex _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"D:cosh", "D:cosh",
&z)) &z))
goto exit; goto exit;
@ -353,19 +353,19 @@ PyDoc_STRVAR(cmath_exp__doc__,
"Return the exponential value e**z."); "Return the exponential value e**z.");
#define CMATH_EXP_METHODDEF \ #define CMATH_EXP_METHODDEF \
{"exp", (PyCFunction)cmath_exp, METH_VARARGS, cmath_exp__doc__}, {"exp", (PyCFunction)cmath_exp, METH_O, cmath_exp__doc__},
static Py_complex static Py_complex
cmath_exp_impl(PyModuleDef *module, Py_complex z); cmath_exp_impl(PyModuleDef *module, Py_complex z);
static PyObject * static PyObject *
cmath_exp(PyModuleDef *module, PyObject *args) cmath_exp(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_complex z; Py_complex z;
Py_complex _return_value; Py_complex _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"D:exp", "D:exp",
&z)) &z))
goto exit; goto exit;
@ -396,19 +396,19 @@ PyDoc_STRVAR(cmath_log10__doc__,
"Return the base-10 logarithm of z."); "Return the base-10 logarithm of z.");
#define CMATH_LOG10_METHODDEF \ #define CMATH_LOG10_METHODDEF \
{"log10", (PyCFunction)cmath_log10, METH_VARARGS, cmath_log10__doc__}, {"log10", (PyCFunction)cmath_log10, METH_O, cmath_log10__doc__},
static Py_complex static Py_complex
cmath_log10_impl(PyModuleDef *module, Py_complex z); cmath_log10_impl(PyModuleDef *module, Py_complex z);
static PyObject * static PyObject *
cmath_log10(PyModuleDef *module, PyObject *args) cmath_log10(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_complex z; Py_complex z;
Py_complex _return_value; Py_complex _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"D:log10", "D:log10",
&z)) &z))
goto exit; goto exit;
@ -439,19 +439,19 @@ PyDoc_STRVAR(cmath_sin__doc__,
"Return the sine of z."); "Return the sine of z.");
#define CMATH_SIN_METHODDEF \ #define CMATH_SIN_METHODDEF \
{"sin", (PyCFunction)cmath_sin, METH_VARARGS, cmath_sin__doc__}, {"sin", (PyCFunction)cmath_sin, METH_O, cmath_sin__doc__},
static Py_complex static Py_complex
cmath_sin_impl(PyModuleDef *module, Py_complex z); cmath_sin_impl(PyModuleDef *module, Py_complex z);
static PyObject * static PyObject *
cmath_sin(PyModuleDef *module, PyObject *args) cmath_sin(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_complex z; Py_complex z;
Py_complex _return_value; Py_complex _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"D:sin", "D:sin",
&z)) &z))
goto exit; goto exit;
@ -482,19 +482,19 @@ PyDoc_STRVAR(cmath_sinh__doc__,
"Return the hyperbolic sine of z."); "Return the hyperbolic sine of z.");
#define CMATH_SINH_METHODDEF \ #define CMATH_SINH_METHODDEF \
{"sinh", (PyCFunction)cmath_sinh, METH_VARARGS, cmath_sinh__doc__}, {"sinh", (PyCFunction)cmath_sinh, METH_O, cmath_sinh__doc__},
static Py_complex static Py_complex
cmath_sinh_impl(PyModuleDef *module, Py_complex z); cmath_sinh_impl(PyModuleDef *module, Py_complex z);
static PyObject * static PyObject *
cmath_sinh(PyModuleDef *module, PyObject *args) cmath_sinh(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_complex z; Py_complex z;
Py_complex _return_value; Py_complex _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"D:sinh", "D:sinh",
&z)) &z))
goto exit; goto exit;
@ -525,19 +525,19 @@ PyDoc_STRVAR(cmath_sqrt__doc__,
"Return the square root of z."); "Return the square root of z.");
#define CMATH_SQRT_METHODDEF \ #define CMATH_SQRT_METHODDEF \
{"sqrt", (PyCFunction)cmath_sqrt, METH_VARARGS, cmath_sqrt__doc__}, {"sqrt", (PyCFunction)cmath_sqrt, METH_O, cmath_sqrt__doc__},
static Py_complex static Py_complex
cmath_sqrt_impl(PyModuleDef *module, Py_complex z); cmath_sqrt_impl(PyModuleDef *module, Py_complex z);
static PyObject * static PyObject *
cmath_sqrt(PyModuleDef *module, PyObject *args) cmath_sqrt(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_complex z; Py_complex z;
Py_complex _return_value; Py_complex _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"D:sqrt", "D:sqrt",
&z)) &z))
goto exit; goto exit;
@ -568,19 +568,19 @@ PyDoc_STRVAR(cmath_tan__doc__,
"Return the tangent of z."); "Return the tangent of z.");
#define CMATH_TAN_METHODDEF \ #define CMATH_TAN_METHODDEF \
{"tan", (PyCFunction)cmath_tan, METH_VARARGS, cmath_tan__doc__}, {"tan", (PyCFunction)cmath_tan, METH_O, cmath_tan__doc__},
static Py_complex static Py_complex
cmath_tan_impl(PyModuleDef *module, Py_complex z); cmath_tan_impl(PyModuleDef *module, Py_complex z);
static PyObject * static PyObject *
cmath_tan(PyModuleDef *module, PyObject *args) cmath_tan(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_complex z; Py_complex z;
Py_complex _return_value; Py_complex _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"D:tan", "D:tan",
&z)) &z))
goto exit; goto exit;
@ -611,19 +611,19 @@ PyDoc_STRVAR(cmath_tanh__doc__,
"Return the hyperbolic tangent of z."); "Return the hyperbolic tangent of z.");
#define CMATH_TANH_METHODDEF \ #define CMATH_TANH_METHODDEF \
{"tanh", (PyCFunction)cmath_tanh, METH_VARARGS, cmath_tanh__doc__}, {"tanh", (PyCFunction)cmath_tanh, METH_O, cmath_tanh__doc__},
static Py_complex static Py_complex
cmath_tanh_impl(PyModuleDef *module, Py_complex z); cmath_tanh_impl(PyModuleDef *module, Py_complex z);
static PyObject * static PyObject *
cmath_tanh(PyModuleDef *module, PyObject *args) cmath_tanh(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_complex z; Py_complex z;
Py_complex _return_value; Py_complex _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"D:tanh", "D:tanh",
&z)) &z))
goto exit; goto exit;
@ -685,18 +685,18 @@ PyDoc_STRVAR(cmath_phase__doc__,
"Return argument, also known as the phase angle, of a complex."); "Return argument, also known as the phase angle, of a complex.");
#define CMATH_PHASE_METHODDEF \ #define CMATH_PHASE_METHODDEF \
{"phase", (PyCFunction)cmath_phase, METH_VARARGS, cmath_phase__doc__}, {"phase", (PyCFunction)cmath_phase, METH_O, cmath_phase__doc__},
static PyObject * static PyObject *
cmath_phase_impl(PyModuleDef *module, Py_complex z); cmath_phase_impl(PyModuleDef *module, Py_complex z);
static PyObject * static PyObject *
cmath_phase(PyModuleDef *module, PyObject *args) cmath_phase(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_complex z; Py_complex z;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"D:phase", "D:phase",
&z)) &z))
goto exit; goto exit;
@ -715,18 +715,18 @@ PyDoc_STRVAR(cmath_polar__doc__,
"r is the distance from 0 and phi the phase angle."); "r is the distance from 0 and phi the phase angle.");
#define CMATH_POLAR_METHODDEF \ #define CMATH_POLAR_METHODDEF \
{"polar", (PyCFunction)cmath_polar, METH_VARARGS, cmath_polar__doc__}, {"polar", (PyCFunction)cmath_polar, METH_O, cmath_polar__doc__},
static PyObject * static PyObject *
cmath_polar_impl(PyModuleDef *module, Py_complex z); cmath_polar_impl(PyModuleDef *module, Py_complex z);
static PyObject * static PyObject *
cmath_polar(PyModuleDef *module, PyObject *args) cmath_polar(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_complex z; Py_complex z;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"D:polar", "D:polar",
&z)) &z))
goto exit; goto exit;
@ -772,18 +772,18 @@ PyDoc_STRVAR(cmath_isfinite__doc__,
"Return True if both the real and imaginary parts of z are finite, else False."); "Return True if both the real and imaginary parts of z are finite, else False.");
#define CMATH_ISFINITE_METHODDEF \ #define CMATH_ISFINITE_METHODDEF \
{"isfinite", (PyCFunction)cmath_isfinite, METH_VARARGS, cmath_isfinite__doc__}, {"isfinite", (PyCFunction)cmath_isfinite, METH_O, cmath_isfinite__doc__},
static PyObject * static PyObject *
cmath_isfinite_impl(PyModuleDef *module, Py_complex z); cmath_isfinite_impl(PyModuleDef *module, Py_complex z);
static PyObject * static PyObject *
cmath_isfinite(PyModuleDef *module, PyObject *args) cmath_isfinite(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_complex z; Py_complex z;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"D:isfinite", "D:isfinite",
&z)) &z))
goto exit; goto exit;
@ -800,18 +800,18 @@ PyDoc_STRVAR(cmath_isnan__doc__,
"Checks if the real or imaginary part of z not a number (NaN)."); "Checks if the real or imaginary part of z not a number (NaN).");
#define CMATH_ISNAN_METHODDEF \ #define CMATH_ISNAN_METHODDEF \
{"isnan", (PyCFunction)cmath_isnan, METH_VARARGS, cmath_isnan__doc__}, {"isnan", (PyCFunction)cmath_isnan, METH_O, cmath_isnan__doc__},
static PyObject * static PyObject *
cmath_isnan_impl(PyModuleDef *module, Py_complex z); cmath_isnan_impl(PyModuleDef *module, Py_complex z);
static PyObject * static PyObject *
cmath_isnan(PyModuleDef *module, PyObject *args) cmath_isnan(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_complex z; Py_complex z;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"D:isnan", "D:isnan",
&z)) &z))
goto exit; goto exit;
@ -828,18 +828,18 @@ PyDoc_STRVAR(cmath_isinf__doc__,
"Checks if the real or imaginary part of z is infinite."); "Checks if the real or imaginary part of z is infinite.");
#define CMATH_ISINF_METHODDEF \ #define CMATH_ISINF_METHODDEF \
{"isinf", (PyCFunction)cmath_isinf, METH_VARARGS, cmath_isinf__doc__}, {"isinf", (PyCFunction)cmath_isinf, METH_O, cmath_isinf__doc__},
static PyObject * static PyObject *
cmath_isinf_impl(PyModuleDef *module, Py_complex z); cmath_isinf_impl(PyModuleDef *module, Py_complex z);
static PyObject * static PyObject *
cmath_isinf(PyModuleDef *module, PyObject *args) cmath_isinf(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_complex z; Py_complex z;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"D:isinf", "D:isinf",
&z)) &z))
goto exit; goto exit;
@ -848,4 +848,4 @@ cmath_isinf(PyModuleDef *module, PyObject *args)
exit: exit:
return return_value; return return_value;
} }
/*[clinic end generated code: output=9b6d81711e4e3c4b input=a9049054013a1b77]*/ /*[clinic end generated code: output=9143b8dcc8069024 input=a9049054013a1b77]*/

View File

@ -168,19 +168,19 @@ PyDoc_STRVAR(os_ttyname__doc__,
" Integer file descriptor handle."); " Integer file descriptor handle.");
#define OS_TTYNAME_METHODDEF \ #define OS_TTYNAME_METHODDEF \
{"ttyname", (PyCFunction)os_ttyname, METH_VARARGS, os_ttyname__doc__}, {"ttyname", (PyCFunction)os_ttyname, METH_O, os_ttyname__doc__},
static char * static char *
os_ttyname_impl(PyModuleDef *module, int fd); os_ttyname_impl(PyModuleDef *module, int fd);
static PyObject * static PyObject *
os_ttyname(PyModuleDef *module, PyObject *args) os_ttyname(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
int fd; int fd;
char *_return_value; char *_return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"i:ttyname", "i:ttyname",
&fd)) &fd))
goto exit; goto exit;
@ -911,18 +911,18 @@ PyDoc_STRVAR(os__getfinalpathname__doc__,
"A helper function for samepath on windows."); "A helper function for samepath on windows.");
#define OS__GETFINALPATHNAME_METHODDEF \ #define OS__GETFINALPATHNAME_METHODDEF \
{"_getfinalpathname", (PyCFunction)os__getfinalpathname, METH_VARARGS, os__getfinalpathname__doc__}, {"_getfinalpathname", (PyCFunction)os__getfinalpathname, METH_O, os__getfinalpathname__doc__},
static PyObject * static PyObject *
os__getfinalpathname_impl(PyModuleDef *module, PyObject *path); os__getfinalpathname_impl(PyModuleDef *module, PyObject *path);
static PyObject * static PyObject *
os__getfinalpathname(PyModuleDef *module, PyObject *args) os__getfinalpathname(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
PyObject *path; PyObject *path;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"U:_getfinalpathname", "U:_getfinalpathname",
&path)) &path))
goto exit; goto exit;
@ -1017,18 +1017,18 @@ PyDoc_STRVAR(os_nice__doc__,
"Add increment to the priority of process and return the new priority."); "Add increment to the priority of process and return the new priority.");
#define OS_NICE_METHODDEF \ #define OS_NICE_METHODDEF \
{"nice", (PyCFunction)os_nice, METH_VARARGS, os_nice__doc__}, {"nice", (PyCFunction)os_nice, METH_O, os_nice__doc__},
static PyObject * static PyObject *
os_nice_impl(PyModuleDef *module, int increment); os_nice_impl(PyModuleDef *module, int increment);
static PyObject * static PyObject *
os_nice(PyModuleDef *module, PyObject *args) os_nice(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
int increment; int increment;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"i:nice", "i:nice",
&increment)) &increment))
goto exit; goto exit;
@ -1317,18 +1317,18 @@ PyDoc_STRVAR(os_umask__doc__,
"Set the current numeric umask and return the previous umask."); "Set the current numeric umask and return the previous umask.");
#define OS_UMASK_METHODDEF \ #define OS_UMASK_METHODDEF \
{"umask", (PyCFunction)os_umask, METH_VARARGS, os_umask__doc__}, {"umask", (PyCFunction)os_umask, METH_O, os_umask__doc__},
static PyObject * static PyObject *
os_umask_impl(PyModuleDef *module, int mask); os_umask_impl(PyModuleDef *module, int mask);
static PyObject * static PyObject *
os_umask(PyModuleDef *module, PyObject *args) os_umask(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
int mask; int mask;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"i:umask", "i:umask",
&mask)) &mask))
goto exit; goto exit;
@ -1829,18 +1829,18 @@ PyDoc_STRVAR(os_sched_getscheduler__doc__,
"Passing 0 for pid returns the scheduling policy for the calling process."); "Passing 0 for pid returns the scheduling policy for the calling process.");
#define OS_SCHED_GETSCHEDULER_METHODDEF \ #define OS_SCHED_GETSCHEDULER_METHODDEF \
{"sched_getscheduler", (PyCFunction)os_sched_getscheduler, METH_VARARGS, os_sched_getscheduler__doc__}, {"sched_getscheduler", (PyCFunction)os_sched_getscheduler, METH_O, os_sched_getscheduler__doc__},
static PyObject * static PyObject *
os_sched_getscheduler_impl(PyModuleDef *module, pid_t pid); os_sched_getscheduler_impl(PyModuleDef *module, pid_t pid);
static PyObject * static PyObject *
os_sched_getscheduler(PyModuleDef *module, PyObject *args) os_sched_getscheduler(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
pid_t pid; pid_t pid;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"" _Py_PARSE_PID ":sched_getscheduler", "" _Py_PARSE_PID ":sched_getscheduler",
&pid)) &pid))
goto exit; goto exit;
@ -1934,18 +1934,18 @@ PyDoc_STRVAR(os_sched_getparam__doc__,
"Return value is an instance of sched_param."); "Return value is an instance of sched_param.");
#define OS_SCHED_GETPARAM_METHODDEF \ #define OS_SCHED_GETPARAM_METHODDEF \
{"sched_getparam", (PyCFunction)os_sched_getparam, METH_VARARGS, os_sched_getparam__doc__}, {"sched_getparam", (PyCFunction)os_sched_getparam, METH_O, os_sched_getparam__doc__},
static PyObject * static PyObject *
os_sched_getparam_impl(PyModuleDef *module, pid_t pid); os_sched_getparam_impl(PyModuleDef *module, pid_t pid);
static PyObject * static PyObject *
os_sched_getparam(PyModuleDef *module, PyObject *args) os_sched_getparam(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
pid_t pid; pid_t pid;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"" _Py_PARSE_PID ":sched_getparam", "" _Py_PARSE_PID ":sched_getparam",
&pid)) &pid))
goto exit; goto exit;
@ -2004,19 +2004,19 @@ PyDoc_STRVAR(os_sched_rr_get_interval__doc__,
"Value returned is a float."); "Value returned is a float.");
#define OS_SCHED_RR_GET_INTERVAL_METHODDEF \ #define OS_SCHED_RR_GET_INTERVAL_METHODDEF \
{"sched_rr_get_interval", (PyCFunction)os_sched_rr_get_interval, METH_VARARGS, os_sched_rr_get_interval__doc__}, {"sched_rr_get_interval", (PyCFunction)os_sched_rr_get_interval, METH_O, os_sched_rr_get_interval__doc__},
static double static double
os_sched_rr_get_interval_impl(PyModuleDef *module, pid_t pid); os_sched_rr_get_interval_impl(PyModuleDef *module, pid_t pid);
static PyObject * static PyObject *
os_sched_rr_get_interval(PyModuleDef *module, PyObject *args) os_sched_rr_get_interval(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
pid_t pid; pid_t pid;
double _return_value; double _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"" _Py_PARSE_PID ":sched_rr_get_interval", "" _Py_PARSE_PID ":sched_rr_get_interval",
&pid)) &pid))
goto exit; goto exit;
@ -2099,18 +2099,18 @@ PyDoc_STRVAR(os_sched_getaffinity__doc__,
"The affinity is returned as a set of CPU identifiers."); "The affinity is returned as a set of CPU identifiers.");
#define OS_SCHED_GETAFFINITY_METHODDEF \ #define OS_SCHED_GETAFFINITY_METHODDEF \
{"sched_getaffinity", (PyCFunction)os_sched_getaffinity, METH_VARARGS, os_sched_getaffinity__doc__}, {"sched_getaffinity", (PyCFunction)os_sched_getaffinity, METH_O, os_sched_getaffinity__doc__},
static PyObject * static PyObject *
os_sched_getaffinity_impl(PyModuleDef *module, pid_t pid); os_sched_getaffinity_impl(PyModuleDef *module, pid_t pid);
static PyObject * static PyObject *
os_sched_getaffinity(PyModuleDef *module, PyObject *args) os_sched_getaffinity(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
pid_t pid; pid_t pid;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"" _Py_PARSE_PID ":sched_getaffinity", "" _Py_PARSE_PID ":sched_getaffinity",
&pid)) &pid))
goto exit; goto exit;
@ -2501,18 +2501,18 @@ PyDoc_STRVAR(os_plock__doc__,
"Lock program segments into memory.\");"); "Lock program segments into memory.\");");
#define OS_PLOCK_METHODDEF \ #define OS_PLOCK_METHODDEF \
{"plock", (PyCFunction)os_plock, METH_VARARGS, os_plock__doc__}, {"plock", (PyCFunction)os_plock, METH_O, os_plock__doc__},
static PyObject * static PyObject *
os_plock_impl(PyModuleDef *module, int op); os_plock_impl(PyModuleDef *module, int op);
static PyObject * static PyObject *
os_plock(PyModuleDef *module, PyObject *args) os_plock(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
int op; int op;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"i:plock", "i:plock",
&op)) &op))
goto exit; goto exit;
@ -2533,18 +2533,18 @@ PyDoc_STRVAR(os_setuid__doc__,
"Set the current process\'s user id."); "Set the current process\'s user id.");
#define OS_SETUID_METHODDEF \ #define OS_SETUID_METHODDEF \
{"setuid", (PyCFunction)os_setuid, METH_VARARGS, os_setuid__doc__}, {"setuid", (PyCFunction)os_setuid, METH_O, os_setuid__doc__},
static PyObject * static PyObject *
os_setuid_impl(PyModuleDef *module, uid_t uid); os_setuid_impl(PyModuleDef *module, uid_t uid);
static PyObject * static PyObject *
os_setuid(PyModuleDef *module, PyObject *args) os_setuid(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
uid_t uid; uid_t uid;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"O&:setuid", "O&:setuid",
_Py_Uid_Converter, &uid)) _Py_Uid_Converter, &uid))
goto exit; goto exit;
@ -2565,18 +2565,18 @@ PyDoc_STRVAR(os_seteuid__doc__,
"Set the current process\'s effective user id."); "Set the current process\'s effective user id.");
#define OS_SETEUID_METHODDEF \ #define OS_SETEUID_METHODDEF \
{"seteuid", (PyCFunction)os_seteuid, METH_VARARGS, os_seteuid__doc__}, {"seteuid", (PyCFunction)os_seteuid, METH_O, os_seteuid__doc__},
static PyObject * static PyObject *
os_seteuid_impl(PyModuleDef *module, uid_t euid); os_seteuid_impl(PyModuleDef *module, uid_t euid);
static PyObject * static PyObject *
os_seteuid(PyModuleDef *module, PyObject *args) os_seteuid(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
uid_t euid; uid_t euid;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"O&:seteuid", "O&:seteuid",
_Py_Uid_Converter, &euid)) _Py_Uid_Converter, &euid))
goto exit; goto exit;
@ -2597,18 +2597,18 @@ PyDoc_STRVAR(os_setegid__doc__,
"Set the current process\'s effective group id."); "Set the current process\'s effective group id.");
#define OS_SETEGID_METHODDEF \ #define OS_SETEGID_METHODDEF \
{"setegid", (PyCFunction)os_setegid, METH_VARARGS, os_setegid__doc__}, {"setegid", (PyCFunction)os_setegid, METH_O, os_setegid__doc__},
static PyObject * static PyObject *
os_setegid_impl(PyModuleDef *module, gid_t egid); os_setegid_impl(PyModuleDef *module, gid_t egid);
static PyObject * static PyObject *
os_setegid(PyModuleDef *module, PyObject *args) os_setegid(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
gid_t egid; gid_t egid;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"O&:setegid", "O&:setegid",
_Py_Gid_Converter, &egid)) _Py_Gid_Converter, &egid))
goto exit; goto exit;
@ -2695,18 +2695,18 @@ PyDoc_STRVAR(os_setgid__doc__,
"Set the current process\'s group id."); "Set the current process\'s group id.");
#define OS_SETGID_METHODDEF \ #define OS_SETGID_METHODDEF \
{"setgid", (PyCFunction)os_setgid, METH_VARARGS, os_setgid__doc__}, {"setgid", (PyCFunction)os_setgid, METH_O, os_setgid__doc__},
static PyObject * static PyObject *
os_setgid_impl(PyModuleDef *module, gid_t gid); os_setgid_impl(PyModuleDef *module, gid_t gid);
static PyObject * static PyObject *
os_setgid(PyModuleDef *module, PyObject *args) os_setgid(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
gid_t gid; gid_t gid;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"O&:setgid", "O&:setgid",
_Py_Gid_Converter, &gid)) _Py_Gid_Converter, &gid))
goto exit; goto exit;
@ -3036,18 +3036,18 @@ PyDoc_STRVAR(os_getsid__doc__,
"Call the system call getsid(pid) and return the result."); "Call the system call getsid(pid) and return the result.");
#define OS_GETSID_METHODDEF \ #define OS_GETSID_METHODDEF \
{"getsid", (PyCFunction)os_getsid, METH_VARARGS, os_getsid__doc__}, {"getsid", (PyCFunction)os_getsid, METH_O, os_getsid__doc__},
static PyObject * static PyObject *
os_getsid_impl(PyModuleDef *module, pid_t pid); os_getsid_impl(PyModuleDef *module, pid_t pid);
static PyObject * static PyObject *
os_getsid(PyModuleDef *module, PyObject *args) os_getsid(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
pid_t pid; pid_t pid;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"" _Py_PARSE_PID ":getsid", "" _Py_PARSE_PID ":getsid",
&pid)) &pid))
goto exit; goto exit;
@ -3123,18 +3123,18 @@ PyDoc_STRVAR(os_tcgetpgrp__doc__,
"Return the process group associated with the terminal specified by fd."); "Return the process group associated with the terminal specified by fd.");
#define OS_TCGETPGRP_METHODDEF \ #define OS_TCGETPGRP_METHODDEF \
{"tcgetpgrp", (PyCFunction)os_tcgetpgrp, METH_VARARGS, os_tcgetpgrp__doc__}, {"tcgetpgrp", (PyCFunction)os_tcgetpgrp, METH_O, os_tcgetpgrp__doc__},
static PyObject * static PyObject *
os_tcgetpgrp_impl(PyModuleDef *module, int fd); os_tcgetpgrp_impl(PyModuleDef *module, int fd);
static PyObject * static PyObject *
os_tcgetpgrp(PyModuleDef *module, PyObject *args) os_tcgetpgrp(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
int fd; int fd;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"i:tcgetpgrp", "i:tcgetpgrp",
&fd)) &fd))
goto exit; goto exit;
@ -3288,19 +3288,19 @@ PyDoc_STRVAR(os_dup__doc__,
"Return a duplicate of a file descriptor."); "Return a duplicate of a file descriptor.");
#define OS_DUP_METHODDEF \ #define OS_DUP_METHODDEF \
{"dup", (PyCFunction)os_dup, METH_VARARGS, os_dup__doc__}, {"dup", (PyCFunction)os_dup, METH_O, os_dup__doc__},
static int static int
os_dup_impl(PyModuleDef *module, int fd); os_dup_impl(PyModuleDef *module, int fd);
static PyObject * static PyObject *
os_dup(PyModuleDef *module, PyObject *args) os_dup(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
int fd; int fd;
int _return_value; int _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"i:dup", "i:dup",
&fd)) &fd))
goto exit; goto exit;
@ -3612,19 +3612,19 @@ PyDoc_STRVAR(os_isatty__doc__,
"connected to the slave end of a terminal."); "connected to the slave end of a terminal.");
#define OS_ISATTY_METHODDEF \ #define OS_ISATTY_METHODDEF \
{"isatty", (PyCFunction)os_isatty, METH_VARARGS, os_isatty__doc__}, {"isatty", (PyCFunction)os_isatty, METH_O, os_isatty__doc__},
static int static int
os_isatty_impl(PyModuleDef *module, int fd); os_isatty_impl(PyModuleDef *module, int fd);
static PyObject * static PyObject *
os_isatty(PyModuleDef *module, PyObject *args) os_isatty(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
int fd; int fd;
int _return_value; int _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"i:isatty", "i:isatty",
&fd)) &fd))
goto exit; goto exit;
@ -3677,18 +3677,18 @@ PyDoc_STRVAR(os_pipe2__doc__,
"O_NONBLOCK, O_CLOEXEC."); "O_NONBLOCK, O_CLOEXEC.");
#define OS_PIPE2_METHODDEF \ #define OS_PIPE2_METHODDEF \
{"pipe2", (PyCFunction)os_pipe2, METH_VARARGS, os_pipe2__doc__}, {"pipe2", (PyCFunction)os_pipe2, METH_O, os_pipe2__doc__},
static PyObject * static PyObject *
os_pipe2_impl(PyModuleDef *module, int flags); os_pipe2_impl(PyModuleDef *module, int flags);
static PyObject * static PyObject *
os_pipe2(PyModuleDef *module, PyObject *args) os_pipe2(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
int flags; int flags;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"i:pipe2", "i:pipe2",
&flags)) &flags))
goto exit; goto exit;
@ -3889,19 +3889,19 @@ PyDoc_STRVAR(os_major__doc__,
"Extracts a device major number from a raw device number."); "Extracts a device major number from a raw device number.");
#define OS_MAJOR_METHODDEF \ #define OS_MAJOR_METHODDEF \
{"major", (PyCFunction)os_major, METH_VARARGS, os_major__doc__}, {"major", (PyCFunction)os_major, METH_O, os_major__doc__},
static unsigned int static unsigned int
os_major_impl(PyModuleDef *module, dev_t device); os_major_impl(PyModuleDef *module, dev_t device);
static PyObject * static PyObject *
os_major(PyModuleDef *module, PyObject *args) os_major(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
dev_t device; dev_t device;
unsigned int _return_value; unsigned int _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"O&:major", "O&:major",
_Py_Dev_Converter, &device)) _Py_Dev_Converter, &device))
goto exit; goto exit;
@ -3925,19 +3925,19 @@ PyDoc_STRVAR(os_minor__doc__,
"Extracts a device minor number from a raw device number."); "Extracts a device minor number from a raw device number.");
#define OS_MINOR_METHODDEF \ #define OS_MINOR_METHODDEF \
{"minor", (PyCFunction)os_minor, METH_VARARGS, os_minor__doc__}, {"minor", (PyCFunction)os_minor, METH_O, os_minor__doc__},
static unsigned int static unsigned int
os_minor_impl(PyModuleDef *module, dev_t device); os_minor_impl(PyModuleDef *module, dev_t device);
static PyObject * static PyObject *
os_minor(PyModuleDef *module, PyObject *args) os_minor(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
dev_t device; dev_t device;
unsigned int _return_value; unsigned int _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"O&:minor", "O&:minor",
_Py_Dev_Converter, &device)) _Py_Dev_Converter, &device))
goto exit; goto exit;
@ -4222,18 +4222,18 @@ PyDoc_STRVAR(os_unsetenv__doc__,
"Delete an environment variable."); "Delete an environment variable.");
#define OS_UNSETENV_METHODDEF \ #define OS_UNSETENV_METHODDEF \
{"unsetenv", (PyCFunction)os_unsetenv, METH_VARARGS, os_unsetenv__doc__}, {"unsetenv", (PyCFunction)os_unsetenv, METH_O, os_unsetenv__doc__},
static PyObject * static PyObject *
os_unsetenv_impl(PyModuleDef *module, PyObject *name); os_unsetenv_impl(PyModuleDef *module, PyObject *name);
static PyObject * static PyObject *
os_unsetenv(PyModuleDef *module, PyObject *args) os_unsetenv(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
PyObject *name = NULL; PyObject *name = NULL;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"O&:unsetenv", "O&:unsetenv",
PyUnicode_FSConverter, &name)) PyUnicode_FSConverter, &name))
goto exit; goto exit;
@ -4255,18 +4255,18 @@ PyDoc_STRVAR(os_strerror__doc__,
"Translate an error code to a message string."); "Translate an error code to a message string.");
#define OS_STRERROR_METHODDEF \ #define OS_STRERROR_METHODDEF \
{"strerror", (PyCFunction)os_strerror, METH_VARARGS, os_strerror__doc__}, {"strerror", (PyCFunction)os_strerror, METH_O, os_strerror__doc__},
static PyObject * static PyObject *
os_strerror_impl(PyModuleDef *module, int code); os_strerror_impl(PyModuleDef *module, int code);
static PyObject * static PyObject *
os_strerror(PyModuleDef *module, PyObject *args) os_strerror(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
int code; int code;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"i:strerror", "i:strerror",
&code)) &code))
goto exit; goto exit;
@ -4285,19 +4285,19 @@ PyDoc_STRVAR(os_WCOREDUMP__doc__,
"Return True if the process returning status was dumped to a core file."); "Return True if the process returning status was dumped to a core file.");
#define OS_WCOREDUMP_METHODDEF \ #define OS_WCOREDUMP_METHODDEF \
{"WCOREDUMP", (PyCFunction)os_WCOREDUMP, METH_VARARGS, os_WCOREDUMP__doc__}, {"WCOREDUMP", (PyCFunction)os_WCOREDUMP, METH_O, os_WCOREDUMP__doc__},
static int static int
os_WCOREDUMP_impl(PyModuleDef *module, int status); os_WCOREDUMP_impl(PyModuleDef *module, int status);
static PyObject * static PyObject *
os_WCOREDUMP(PyModuleDef *module, PyObject *args) os_WCOREDUMP(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
int status; int status;
int _return_value; int _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"i:WCOREDUMP", "i:WCOREDUMP",
&status)) &status))
goto exit; goto exit;
@ -4585,18 +4585,18 @@ PyDoc_STRVAR(os_fstatvfs__doc__,
"Equivalent to statvfs(fd)."); "Equivalent to statvfs(fd).");
#define OS_FSTATVFS_METHODDEF \ #define OS_FSTATVFS_METHODDEF \
{"fstatvfs", (PyCFunction)os_fstatvfs, METH_VARARGS, os_fstatvfs__doc__}, {"fstatvfs", (PyCFunction)os_fstatvfs, METH_O, os_fstatvfs__doc__},
static PyObject * static PyObject *
os_fstatvfs_impl(PyModuleDef *module, int fd); os_fstatvfs_impl(PyModuleDef *module, int fd);
static PyObject * static PyObject *
os_fstatvfs(PyModuleDef *module, PyObject *args) os_fstatvfs(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
int fd; int fd;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"i:fstatvfs", "i:fstatvfs",
&fd)) &fd))
goto exit; goto exit;
@ -4774,18 +4774,18 @@ PyDoc_STRVAR(os_confstr__doc__,
"Return a string-valued system configuration variable."); "Return a string-valued system configuration variable.");
#define OS_CONFSTR_METHODDEF \ #define OS_CONFSTR_METHODDEF \
{"confstr", (PyCFunction)os_confstr, METH_VARARGS, os_confstr__doc__}, {"confstr", (PyCFunction)os_confstr, METH_O, os_confstr__doc__},
static PyObject * static PyObject *
os_confstr_impl(PyModuleDef *module, int name); os_confstr_impl(PyModuleDef *module, int name);
static PyObject * static PyObject *
os_confstr(PyModuleDef *module, PyObject *args) os_confstr(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
int name; int name;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"O&:confstr", "O&:confstr",
conv_confstr_confname, &name)) conv_confstr_confname, &name))
goto exit; goto exit;
@ -4806,19 +4806,19 @@ PyDoc_STRVAR(os_sysconf__doc__,
"Return an integer-valued system configuration variable."); "Return an integer-valued system configuration variable.");
#define OS_SYSCONF_METHODDEF \ #define OS_SYSCONF_METHODDEF \
{"sysconf", (PyCFunction)os_sysconf, METH_VARARGS, os_sysconf__doc__}, {"sysconf", (PyCFunction)os_sysconf, METH_O, os_sysconf__doc__},
static long static long
os_sysconf_impl(PyModuleDef *module, int name); os_sysconf_impl(PyModuleDef *module, int name);
static PyObject * static PyObject *
os_sysconf(PyModuleDef *module, PyObject *args) os_sysconf(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
int name; int name;
long _return_value; long _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"O&:sysconf", "O&:sysconf",
conv_sysconf_confname, &name)) conv_sysconf_confname, &name))
goto exit; goto exit;
@ -5215,18 +5215,18 @@ PyDoc_STRVAR(os_urandom__doc__,
"Return a bytes object containing random bytes suitable for cryptographic use."); "Return a bytes object containing random bytes suitable for cryptographic use.");
#define OS_URANDOM_METHODDEF \ #define OS_URANDOM_METHODDEF \
{"urandom", (PyCFunction)os_urandom, METH_VARARGS, os_urandom__doc__}, {"urandom", (PyCFunction)os_urandom, METH_O, os_urandom__doc__},
static PyObject * static PyObject *
os_urandom_impl(PyModuleDef *module, Py_ssize_t size); os_urandom_impl(PyModuleDef *module, Py_ssize_t size);
static PyObject * static PyObject *
os_urandom(PyModuleDef *module, PyObject *args) os_urandom(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_ssize_t size; Py_ssize_t size;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"n:urandom", "n:urandom",
&size)) &size))
goto exit; goto exit;
@ -5261,19 +5261,19 @@ PyDoc_STRVAR(os_get_inheritable__doc__,
"Get the close-on-exe flag of the specified file descriptor."); "Get the close-on-exe flag of the specified file descriptor.");
#define OS_GET_INHERITABLE_METHODDEF \ #define OS_GET_INHERITABLE_METHODDEF \
{"get_inheritable", (PyCFunction)os_get_inheritable, METH_VARARGS, os_get_inheritable__doc__}, {"get_inheritable", (PyCFunction)os_get_inheritable, METH_O, os_get_inheritable__doc__},
static int static int
os_get_inheritable_impl(PyModuleDef *module, int fd); os_get_inheritable_impl(PyModuleDef *module, int fd);
static PyObject * static PyObject *
os_get_inheritable(PyModuleDef *module, PyObject *args) os_get_inheritable(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
int fd; int fd;
int _return_value; int _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"i:get_inheritable", "i:get_inheritable",
&fd)) &fd))
goto exit; goto exit;
@ -5324,19 +5324,19 @@ PyDoc_STRVAR(os_get_handle_inheritable__doc__,
"Get the close-on-exe flag of the specified file descriptor."); "Get the close-on-exe flag of the specified file descriptor.");
#define OS_GET_HANDLE_INHERITABLE_METHODDEF \ #define OS_GET_HANDLE_INHERITABLE_METHODDEF \
{"get_handle_inheritable", (PyCFunction)os_get_handle_inheritable, METH_VARARGS, os_get_handle_inheritable__doc__}, {"get_handle_inheritable", (PyCFunction)os_get_handle_inheritable, METH_O, os_get_handle_inheritable__doc__},
static int static int
os_get_handle_inheritable_impl(PyModuleDef *module, Py_intptr_t handle); os_get_handle_inheritable_impl(PyModuleDef *module, Py_intptr_t handle);
static PyObject * static PyObject *
os_get_handle_inheritable(PyModuleDef *module, PyObject *args) os_get_handle_inheritable(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_intptr_t handle; Py_intptr_t handle;
int _return_value; int _return_value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"" _Py_PARSE_INTPTR ":get_handle_inheritable", "" _Py_PARSE_INTPTR ":get_handle_inheritable",
&handle)) &handle))
goto exit; goto exit;
@ -5847,4 +5847,4 @@ exit:
#ifndef OS_SET_HANDLE_INHERITABLE_METHODDEF #ifndef OS_SET_HANDLE_INHERITABLE_METHODDEF
#define OS_SET_HANDLE_INHERITABLE_METHODDEF #define OS_SET_HANDLE_INHERITABLE_METHODDEF
#endif /* !defined(OS_SET_HANDLE_INHERITABLE_METHODDEF) */ #endif /* !defined(OS_SET_HANDLE_INHERITABLE_METHODDEF) */
/*[clinic end generated code: output=d17c625afa72886b input=a9049054013a1b77]*/ /*[clinic end generated code: output=b15ceac3a8ff0eae input=a9049054013a1b77]*/

View File

@ -22,18 +22,18 @@ PyDoc_STRVAR(pwd_getpwnam__doc__,
"See `help(pwd)` for more on password database entries."); "See `help(pwd)` for more on password database entries.");
#define PWD_GETPWNAM_METHODDEF \ #define PWD_GETPWNAM_METHODDEF \
{"getpwnam", (PyCFunction)pwd_getpwnam, METH_VARARGS, pwd_getpwnam__doc__}, {"getpwnam", (PyCFunction)pwd_getpwnam, METH_O, pwd_getpwnam__doc__},
static PyObject * static PyObject *
pwd_getpwnam_impl(PyModuleDef *module, PyObject *arg); pwd_getpwnam_impl(PyModuleDef *module, PyObject *arg);
static PyObject * static PyObject *
pwd_getpwnam(PyModuleDef *module, PyObject *args) pwd_getpwnam(PyModuleDef *module, PyObject *arg_)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
PyObject *arg; PyObject *arg;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg_,
"U:getpwnam", "U:getpwnam",
&arg)) &arg))
goto exit; goto exit;
@ -70,4 +70,4 @@ pwd_getpwall(PyModuleDef *module, PyObject *Py_UNUSED(ignored))
#ifndef PWD_GETPWALL_METHODDEF #ifndef PWD_GETPWALL_METHODDEF
#define PWD_GETPWALL_METHODDEF #define PWD_GETPWALL_METHODDEF
#endif /* !defined(PWD_GETPWALL_METHODDEF) */ #endif /* !defined(PWD_GETPWALL_METHODDEF) */
/*[clinic end generated code: output=2e23f920020a750a input=a9049054013a1b77]*/ /*[clinic end generated code: output=e7d5ac24b20e91ae input=a9049054013a1b77]*/

View File

@ -49,18 +49,18 @@ PyDoc_STRVAR(pyexpat_xmlparser_SetBase__doc__,
"Set the base URL for the parser."); "Set the base URL for the parser.");
#define PYEXPAT_XMLPARSER_SETBASE_METHODDEF \ #define PYEXPAT_XMLPARSER_SETBASE_METHODDEF \
{"SetBase", (PyCFunction)pyexpat_xmlparser_SetBase, METH_VARARGS, pyexpat_xmlparser_SetBase__doc__}, {"SetBase", (PyCFunction)pyexpat_xmlparser_SetBase, METH_O, pyexpat_xmlparser_SetBase__doc__},
static PyObject * static PyObject *
pyexpat_xmlparser_SetBase_impl(xmlparseobject *self, const char *base); pyexpat_xmlparser_SetBase_impl(xmlparseobject *self, const char *base);
static PyObject * static PyObject *
pyexpat_xmlparser_SetBase(xmlparseobject *self, PyObject *args) pyexpat_xmlparser_SetBase(xmlparseobject *self, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
const char *base; const char *base;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"s:SetBase", "s:SetBase",
&base)) &base))
goto exit; goto exit;
@ -150,18 +150,18 @@ PyDoc_STRVAR(pyexpat_xmlparser_SetParamEntityParsing__doc__,
"was successful."); "was successful.");
#define PYEXPAT_XMLPARSER_SETPARAMENTITYPARSING_METHODDEF \ #define PYEXPAT_XMLPARSER_SETPARAMENTITYPARSING_METHODDEF \
{"SetParamEntityParsing", (PyCFunction)pyexpat_xmlparser_SetParamEntityParsing, METH_VARARGS, pyexpat_xmlparser_SetParamEntityParsing__doc__}, {"SetParamEntityParsing", (PyCFunction)pyexpat_xmlparser_SetParamEntityParsing, METH_O, pyexpat_xmlparser_SetParamEntityParsing__doc__},
static PyObject * static PyObject *
pyexpat_xmlparser_SetParamEntityParsing_impl(xmlparseobject *self, int flag); pyexpat_xmlparser_SetParamEntityParsing_impl(xmlparseobject *self, int flag);
static PyObject * static PyObject *
pyexpat_xmlparser_SetParamEntityParsing(xmlparseobject *self, PyObject *args) pyexpat_xmlparser_SetParamEntityParsing(xmlparseobject *self, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
int flag; int flag;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"i:SetParamEntityParsing", "i:SetParamEntityParsing",
&flag)) &flag))
goto exit; goto exit;
@ -262,18 +262,18 @@ PyDoc_STRVAR(pyexpat_ErrorString__doc__,
"Returns string error for given number."); "Returns string error for given number.");
#define PYEXPAT_ERRORSTRING_METHODDEF \ #define PYEXPAT_ERRORSTRING_METHODDEF \
{"ErrorString", (PyCFunction)pyexpat_ErrorString, METH_VARARGS, pyexpat_ErrorString__doc__}, {"ErrorString", (PyCFunction)pyexpat_ErrorString, METH_O, pyexpat_ErrorString__doc__},
static PyObject * static PyObject *
pyexpat_ErrorString_impl(PyModuleDef *module, long code); pyexpat_ErrorString_impl(PyModuleDef *module, long code);
static PyObject * static PyObject *
pyexpat_ErrorString(PyModuleDef *module, PyObject *args) pyexpat_ErrorString(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
long code; long code;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"l:ErrorString", "l:ErrorString",
&code)) &code))
goto exit; goto exit;
@ -286,4 +286,4 @@ exit:
#ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
#define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
#endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */ #endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */
/*[clinic end generated code: output=0198390005e40e1c input=a9049054013a1b77]*/ /*[clinic end generated code: output=9715b916f2d618fa input=a9049054013a1b77]*/

View File

@ -13,18 +13,18 @@ PyDoc_STRVAR(spwd_getspnam__doc__,
"See `help(spwd)` for more on shadow password database entries."); "See `help(spwd)` for more on shadow password database entries.");
#define SPWD_GETSPNAM_METHODDEF \ #define SPWD_GETSPNAM_METHODDEF \
{"getspnam", (PyCFunction)spwd_getspnam, METH_VARARGS, spwd_getspnam__doc__}, {"getspnam", (PyCFunction)spwd_getspnam, METH_O, spwd_getspnam__doc__},
static PyObject * static PyObject *
spwd_getspnam_impl(PyModuleDef *module, PyObject *arg); spwd_getspnam_impl(PyModuleDef *module, PyObject *arg);
static PyObject * static PyObject *
spwd_getspnam(PyModuleDef *module, PyObject *args) spwd_getspnam(PyModuleDef *module, PyObject *arg_)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
PyObject *arg; PyObject *arg;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg_,
"U:getspnam", "U:getspnam",
&arg)) &arg))
goto exit; goto exit;
@ -67,4 +67,4 @@ spwd_getspall(PyModuleDef *module, PyObject *Py_UNUSED(ignored))
#ifndef SPWD_GETSPALL_METHODDEF #ifndef SPWD_GETSPALL_METHODDEF
#define SPWD_GETSPALL_METHODDEF #define SPWD_GETSPALL_METHODDEF
#endif /* !defined(SPWD_GETSPALL_METHODDEF) */ #endif /* !defined(SPWD_GETSPALL_METHODDEF) */
/*[clinic end generated code: output=ab16125c5e5f2b1b input=a9049054013a1b77]*/ /*[clinic end generated code: output=67a4f8c47008f28f input=a9049054013a1b77]*/

View File

@ -189,18 +189,18 @@ PyDoc_STRVAR(zlib_Compress_compress__doc__,
"Call the flush() method to clear these buffers."); "Call the flush() method to clear these buffers.");
#define ZLIB_COMPRESS_COMPRESS_METHODDEF \ #define ZLIB_COMPRESS_COMPRESS_METHODDEF \
{"compress", (PyCFunction)zlib_Compress_compress, METH_VARARGS, zlib_Compress_compress__doc__}, {"compress", (PyCFunction)zlib_Compress_compress, METH_O, zlib_Compress_compress__doc__},
static PyObject * static PyObject *
zlib_Compress_compress_impl(compobject *self, Py_buffer *data); zlib_Compress_compress_impl(compobject *self, Py_buffer *data);
static PyObject * static PyObject *
zlib_Compress_compress(compobject *self, PyObject *args) zlib_Compress_compress(compobject *self, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL}; Py_buffer data = {NULL, NULL};
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"y*:compress", "y*:compress",
&data)) &data))
goto exit; goto exit;
@ -446,4 +446,4 @@ exit:
#ifndef ZLIB_COMPRESS_COPY_METHODDEF #ifndef ZLIB_COMPRESS_COPY_METHODDEF
#define ZLIB_COMPRESS_COPY_METHODDEF #define ZLIB_COMPRESS_COPY_METHODDEF
#endif /* !defined(ZLIB_COMPRESS_COPY_METHODDEF) */ #endif /* !defined(ZLIB_COMPRESS_COPY_METHODDEF) */
/*[clinic end generated code: output=901c18189767dc08 input=a9049054013a1b77]*/ /*[clinic end generated code: output=0743b1aa908f0b68 input=a9049054013a1b77]*/

View File

@ -339,18 +339,18 @@ PyDoc_STRVAR(bytearray_append__doc__,
" The item to be appended."); " The item to be appended.");
#define BYTEARRAY_APPEND_METHODDEF \ #define BYTEARRAY_APPEND_METHODDEF \
{"append", (PyCFunction)bytearray_append, METH_VARARGS, bytearray_append__doc__}, {"append", (PyCFunction)bytearray_append, METH_O, bytearray_append__doc__},
static PyObject * static PyObject *
bytearray_append_impl(PyByteArrayObject *self, int item); bytearray_append_impl(PyByteArrayObject *self, int item);
static PyObject * static PyObject *
bytearray_append(PyByteArrayObject *self, PyObject *args) bytearray_append(PyByteArrayObject *self, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
int item; int item;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"O&:append", "O&:append",
_getbytevalue, &item)) _getbytevalue, &item))
goto exit; goto exit;
@ -416,18 +416,18 @@ PyDoc_STRVAR(bytearray_remove__doc__,
" The value to remove."); " The value to remove.");
#define BYTEARRAY_REMOVE_METHODDEF \ #define BYTEARRAY_REMOVE_METHODDEF \
{"remove", (PyCFunction)bytearray_remove, METH_VARARGS, bytearray_remove__doc__}, {"remove", (PyCFunction)bytearray_remove, METH_O, bytearray_remove__doc__},
static PyObject * static PyObject *
bytearray_remove_impl(PyByteArrayObject *self, int value); bytearray_remove_impl(PyByteArrayObject *self, int value);
static PyObject * static PyObject *
bytearray_remove(PyByteArrayObject *self, PyObject *args) bytearray_remove(PyByteArrayObject *self, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
int value; int value;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"O&:remove", "O&:remove",
_getbytevalue, &value)) _getbytevalue, &value))
goto exit; goto exit;
@ -621,18 +621,18 @@ PyDoc_STRVAR(bytearray_fromhex__doc__,
"Example: bytearray.fromhex(\'B9 01EF\') -> bytearray(b\'\\\\xb9\\\\x01\\\\xef\')"); "Example: bytearray.fromhex(\'B9 01EF\') -> bytearray(b\'\\\\xb9\\\\x01\\\\xef\')");
#define BYTEARRAY_FROMHEX_METHODDEF \ #define BYTEARRAY_FROMHEX_METHODDEF \
{"fromhex", (PyCFunction)bytearray_fromhex, METH_VARARGS|METH_CLASS, bytearray_fromhex__doc__}, {"fromhex", (PyCFunction)bytearray_fromhex, METH_O|METH_CLASS, bytearray_fromhex__doc__},
static PyObject * static PyObject *
bytearray_fromhex_impl(PyObject*cls, PyObject *string); bytearray_fromhex_impl(PyObject*cls, PyObject *string);
static PyObject * static PyObject *
bytearray_fromhex(PyTypeObject *cls, PyObject *args) bytearray_fromhex(PyTypeObject *cls, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
PyObject *string; PyObject *string;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"U:fromhex", "U:fromhex",
&string)) &string))
goto exit; goto exit;
@ -705,4 +705,4 @@ bytearray_sizeof(PyByteArrayObject *self, PyObject *Py_UNUSED(ignored))
{ {
return bytearray_sizeof_impl(self); return bytearray_sizeof_impl(self);
} }
/*[clinic end generated code: output=70ea384faeca8d16 input=a9049054013a1b77]*/ /*[clinic end generated code: output=d763876718a66fc3 input=a9049054013a1b77]*/

View File

@ -54,18 +54,18 @@ PyDoc_STRVAR(bytes_partition__doc__,
"object and two empty bytes objects."); "object and two empty bytes objects.");
#define BYTES_PARTITION_METHODDEF \ #define BYTES_PARTITION_METHODDEF \
{"partition", (PyCFunction)bytes_partition, METH_VARARGS, bytes_partition__doc__}, {"partition", (PyCFunction)bytes_partition, METH_O, bytes_partition__doc__},
static PyObject * static PyObject *
bytes_partition_impl(PyBytesObject *self, Py_buffer *sep); bytes_partition_impl(PyBytesObject *self, Py_buffer *sep);
static PyObject * static PyObject *
bytes_partition(PyBytesObject *self, PyObject *args) bytes_partition(PyBytesObject *self, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_buffer sep = {NULL, NULL}; Py_buffer sep = {NULL, NULL};
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"y*:partition", "y*:partition",
&sep)) &sep))
goto exit; goto exit;
@ -93,18 +93,18 @@ PyDoc_STRVAR(bytes_rpartition__doc__,
"objects and the original bytes object."); "objects and the original bytes object.");
#define BYTES_RPARTITION_METHODDEF \ #define BYTES_RPARTITION_METHODDEF \
{"rpartition", (PyCFunction)bytes_rpartition, METH_VARARGS, bytes_rpartition__doc__}, {"rpartition", (PyCFunction)bytes_rpartition, METH_O, bytes_rpartition__doc__},
static PyObject * static PyObject *
bytes_rpartition_impl(PyBytesObject *self, Py_buffer *sep); bytes_rpartition_impl(PyBytesObject *self, Py_buffer *sep);
static PyObject * static PyObject *
bytes_rpartition(PyBytesObject *self, PyObject *args) bytes_rpartition(PyBytesObject *self, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_buffer sep = {NULL, NULL}; Py_buffer sep = {NULL, NULL};
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"y*:rpartition", "y*:rpartition",
&sep)) &sep))
goto exit; goto exit;
@ -473,18 +473,18 @@ PyDoc_STRVAR(bytes_fromhex__doc__,
"Example: bytes.fromhex(\'B9 01EF\') -> b\'\\\\xb9\\\\x01\\\\xef\'."); "Example: bytes.fromhex(\'B9 01EF\') -> b\'\\\\xb9\\\\x01\\\\xef\'.");
#define BYTES_FROMHEX_METHODDEF \ #define BYTES_FROMHEX_METHODDEF \
{"fromhex", (PyCFunction)bytes_fromhex, METH_VARARGS|METH_CLASS, bytes_fromhex__doc__}, {"fromhex", (PyCFunction)bytes_fromhex, METH_O|METH_CLASS, bytes_fromhex__doc__},
static PyObject * static PyObject *
bytes_fromhex_impl(PyTypeObject *type, PyObject *string); bytes_fromhex_impl(PyTypeObject *type, PyObject *string);
static PyObject * static PyObject *
bytes_fromhex(PyTypeObject *type, PyObject *args) bytes_fromhex(PyTypeObject *type, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
PyObject *string; PyObject *string;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"U:fromhex", "U:fromhex",
&string)) &string))
goto exit; goto exit;
@ -493,4 +493,4 @@ bytes_fromhex(PyTypeObject *type, PyObject *args)
exit: exit:
return return_value; return return_value;
} }
/*[clinic end generated code: output=dfe5c9a317b99f49 input=a9049054013a1b77]*/ /*[clinic end generated code: output=b9e69e1f7c8ccd14 input=a9049054013a1b77]*/

View File

@ -109,18 +109,18 @@ PyDoc_STRVAR(builtin_chr__doc__,
"Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff."); "Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff.");
#define BUILTIN_CHR_METHODDEF \ #define BUILTIN_CHR_METHODDEF \
{"chr", (PyCFunction)builtin_chr, METH_VARARGS, builtin_chr__doc__}, {"chr", (PyCFunction)builtin_chr, METH_O, builtin_chr__doc__},
static PyObject * static PyObject *
builtin_chr_impl(PyModuleDef *module, int i); builtin_chr_impl(PyModuleDef *module, int i);
static PyObject * static PyObject *
builtin_chr(PyModuleDef *module, PyObject *args) builtin_chr(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
int i; int i;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"i:chr", "i:chr",
&i)) &i))
goto exit; goto exit;
@ -656,4 +656,4 @@ builtin_issubclass(PyModuleDef *module, PyObject *args)
exit: exit:
return return_value; return return_value;
} }
/*[clinic end generated code: output=2da46de189e48d26 input=a9049054013a1b77]*/ /*[clinic end generated code: output=12db4cde92eb11b3 input=a9049054013a1b77]*/

View File

@ -122,18 +122,18 @@ PyDoc_STRVAR(_imp_init_builtin__doc__,
"Initializes a built-in module."); "Initializes a built-in module.");
#define _IMP_INIT_BUILTIN_METHODDEF \ #define _IMP_INIT_BUILTIN_METHODDEF \
{"init_builtin", (PyCFunction)_imp_init_builtin, METH_VARARGS, _imp_init_builtin__doc__}, {"init_builtin", (PyCFunction)_imp_init_builtin, METH_O, _imp_init_builtin__doc__},
static PyObject * static PyObject *
_imp_init_builtin_impl(PyModuleDef *module, PyObject *name); _imp_init_builtin_impl(PyModuleDef *module, PyObject *name);
static PyObject * static PyObject *
_imp_init_builtin(PyModuleDef *module, PyObject *args) _imp_init_builtin(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
PyObject *name; PyObject *name;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"U:init_builtin", "U:init_builtin",
&name)) &name))
goto exit; goto exit;
@ -150,18 +150,18 @@ PyDoc_STRVAR(_imp_init_frozen__doc__,
"Initializes a frozen module."); "Initializes a frozen module.");
#define _IMP_INIT_FROZEN_METHODDEF \ #define _IMP_INIT_FROZEN_METHODDEF \
{"init_frozen", (PyCFunction)_imp_init_frozen, METH_VARARGS, _imp_init_frozen__doc__}, {"init_frozen", (PyCFunction)_imp_init_frozen, METH_O, _imp_init_frozen__doc__},
static PyObject * static PyObject *
_imp_init_frozen_impl(PyModuleDef *module, PyObject *name); _imp_init_frozen_impl(PyModuleDef *module, PyObject *name);
static PyObject * static PyObject *
_imp_init_frozen(PyModuleDef *module, PyObject *args) _imp_init_frozen(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
PyObject *name; PyObject *name;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"U:init_frozen", "U:init_frozen",
&name)) &name))
goto exit; goto exit;
@ -178,18 +178,18 @@ PyDoc_STRVAR(_imp_get_frozen_object__doc__,
"Create a code object for a frozen module."); "Create a code object for a frozen module.");
#define _IMP_GET_FROZEN_OBJECT_METHODDEF \ #define _IMP_GET_FROZEN_OBJECT_METHODDEF \
{"get_frozen_object", (PyCFunction)_imp_get_frozen_object, METH_VARARGS, _imp_get_frozen_object__doc__}, {"get_frozen_object", (PyCFunction)_imp_get_frozen_object, METH_O, _imp_get_frozen_object__doc__},
static PyObject * static PyObject *
_imp_get_frozen_object_impl(PyModuleDef *module, PyObject *name); _imp_get_frozen_object_impl(PyModuleDef *module, PyObject *name);
static PyObject * static PyObject *
_imp_get_frozen_object(PyModuleDef *module, PyObject *args) _imp_get_frozen_object(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
PyObject *name; PyObject *name;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"U:get_frozen_object", "U:get_frozen_object",
&name)) &name))
goto exit; goto exit;
@ -206,18 +206,18 @@ PyDoc_STRVAR(_imp_is_frozen_package__doc__,
"Returns True if the module name is of a frozen package."); "Returns True if the module name is of a frozen package.");
#define _IMP_IS_FROZEN_PACKAGE_METHODDEF \ #define _IMP_IS_FROZEN_PACKAGE_METHODDEF \
{"is_frozen_package", (PyCFunction)_imp_is_frozen_package, METH_VARARGS, _imp_is_frozen_package__doc__}, {"is_frozen_package", (PyCFunction)_imp_is_frozen_package, METH_O, _imp_is_frozen_package__doc__},
static PyObject * static PyObject *
_imp_is_frozen_package_impl(PyModuleDef *module, PyObject *name); _imp_is_frozen_package_impl(PyModuleDef *module, PyObject *name);
static PyObject * static PyObject *
_imp_is_frozen_package(PyModuleDef *module, PyObject *args) _imp_is_frozen_package(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
PyObject *name; PyObject *name;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"U:is_frozen_package", "U:is_frozen_package",
&name)) &name))
goto exit; goto exit;
@ -234,18 +234,18 @@ PyDoc_STRVAR(_imp_is_builtin__doc__,
"Returns True if the module name corresponds to a built-in module."); "Returns True if the module name corresponds to a built-in module.");
#define _IMP_IS_BUILTIN_METHODDEF \ #define _IMP_IS_BUILTIN_METHODDEF \
{"is_builtin", (PyCFunction)_imp_is_builtin, METH_VARARGS, _imp_is_builtin__doc__}, {"is_builtin", (PyCFunction)_imp_is_builtin, METH_O, _imp_is_builtin__doc__},
static PyObject * static PyObject *
_imp_is_builtin_impl(PyModuleDef *module, PyObject *name); _imp_is_builtin_impl(PyModuleDef *module, PyObject *name);
static PyObject * static PyObject *
_imp_is_builtin(PyModuleDef *module, PyObject *args) _imp_is_builtin(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
PyObject *name; PyObject *name;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"U:is_builtin", "U:is_builtin",
&name)) &name))
goto exit; goto exit;
@ -262,18 +262,18 @@ PyDoc_STRVAR(_imp_is_frozen__doc__,
"Returns True if the module name corresponds to a frozen module."); "Returns True if the module name corresponds to a frozen module.");
#define _IMP_IS_FROZEN_METHODDEF \ #define _IMP_IS_FROZEN_METHODDEF \
{"is_frozen", (PyCFunction)_imp_is_frozen, METH_VARARGS, _imp_is_frozen__doc__}, {"is_frozen", (PyCFunction)_imp_is_frozen, METH_O, _imp_is_frozen__doc__},
static PyObject * static PyObject *
_imp_is_frozen_impl(PyModuleDef *module, PyObject *name); _imp_is_frozen_impl(PyModuleDef *module, PyObject *name);
static PyObject * static PyObject *
_imp_is_frozen(PyModuleDef *module, PyObject *args) _imp_is_frozen(PyModuleDef *module, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
PyObject *name; PyObject *name;
if (!PyArg_ParseTuple(args, if (!PyArg_Parse(arg,
"U:is_frozen", "U:is_frozen",
&name)) &name))
goto exit; goto exit;
@ -320,4 +320,4 @@ exit:
#ifndef _IMP_LOAD_DYNAMIC_METHODDEF #ifndef _IMP_LOAD_DYNAMIC_METHODDEF
#define _IMP_LOAD_DYNAMIC_METHODDEF #define _IMP_LOAD_DYNAMIC_METHODDEF
#endif /* !defined(_IMP_LOAD_DYNAMIC_METHODDEF) */ #endif /* !defined(_IMP_LOAD_DYNAMIC_METHODDEF) */
/*[clinic end generated code: output=087a1f22e9febcc7 input=a9049054013a1b77]*/ /*[clinic end generated code: output=d41c392510815c5b input=a9049054013a1b77]*/

View File

@ -593,8 +593,6 @@ class CLanguage(Language):
meth_o = (len(parameters) == 1 and meth_o = (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
isinstance(converters[0], object_converter) and
converters[0].format_unit == 'O' and
not new_or_init) not new_or_init)
# we have to set these things before we're done: # we have to set these things before we're done:
@ -700,22 +698,40 @@ class CLanguage(Language):
elif meth_o: elif meth_o:
flags = "METH_O" flags = "METH_O"
meth_o_prototype = normalize_snippet(""" if (isinstance(converters[0], object_converter) and
static PyObject * converters[0].format_unit == 'O'):
{c_basename}({impl_parameters}) meth_o_prototype = normalize_snippet("""
""") static PyObject *
{c_basename}({impl_parameters})
""")
if default_return_converter:
# maps perfectly to METH_O, doesn't need a return converter.
# so we skip making a parse function
# and call directly into the impl function.
impl_prototype = parser_prototype = parser_definition = ''
impl_definition = meth_o_prototype
else:
# SLIGHT HACK
# use impl_parameters for the parser here!
parser_prototype = meth_o_prototype
parser_definition = parser_body(parser_prototype)
if default_return_converter:
# maps perfectly to METH_O, doesn't need a return converter.
# so we skip making a parse function
# and call directly into the impl function.
impl_prototype = parser_prototype = parser_definition = ''
impl_definition = meth_o_prototype
else: else:
# SLIGHT HACK argname = 'arg'
# use impl_parameters for the parser here! if parameters[0].name == argname:
parser_prototype = meth_o_prototype argname += '_'
parser_definition = parser_body(parser_prototype) parser_prototype = normalize_snippet("""
static PyObject *
{c_basename}({self_type}{self_name}, PyObject *%s)
""" % argname)
parser_definition = parser_body(parser_prototype, normalize_snippet("""
if (!PyArg_Parse(%s,
"{format_units}:{name}",
{parse_arguments}))
goto exit;
""" % argname, indent=4))
elif has_option_groups: elif has_option_groups:
# positional parameters with option groups # positional parameters with option groups
@ -1025,7 +1041,7 @@ class CLanguage(Language):
# METH_O, we have exactly one anyway, so we know exactly # METH_O, we have exactly one anyway, so we know exactly
# where it is. # where it is.
if ("METH_O" in templates['methoddef_define'] and if ("METH_O" in templates['methoddef_define'] and
not default_return_converter): '{impl_parameters}' in templates['parser_prototype']):
data.declarations.pop(0) data.declarations.pop(0)
template_dict = {} template_dict = {}