diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2024-04-12 09:22:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-12 09:22:17 (GMT) |
commit | 35f60c3def32f83c73c9314809569cb7793f985c (patch) | |
tree | d1ad1e6bf32e74e7b16b10a8da1873939552b294 | |
parent | 2638c28be07679bf56e38e586fabddd43b19c9bc (diff) | |
download | cpython-35f60c3def32f83c73c9314809569cb7793f985c.zip cpython-35f60c3def32f83c73c9314809569cb7793f985c.tar.gz cpython-35f60c3def32f83c73c9314809569cb7793f985c.tar.bz2 |
gh-117764: Add signatures for __reduce__ and __reduce_ex__ in the _io module (GH-117773)
__reduce__() does not have parameters, __reduce_ex__() has a single
parameter.
-rw-r--r-- | Modules/_io/bufferedio.c | 12 | ||||
-rw-r--r-- | Modules/_io/fileio.c | 4 | ||||
-rw-r--r-- | Modules/_io/textio.c | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index b3450ee..4133d34 100644 --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -2531,8 +2531,8 @@ static PyMethodDef bufferedreader_methods[] = { _IO__BUFFERED_TRUNCATE_METHODDEF _IO__BUFFERED___SIZEOF___METHODDEF - {"__reduce__", _PyIOBase_cannot_pickle, METH_VARARGS}, - {"__reduce_ex__", _PyIOBase_cannot_pickle, METH_VARARGS}, + {"__reduce__", _PyIOBase_cannot_pickle, METH_NOARGS}, + {"__reduce_ex__", _PyIOBase_cannot_pickle, METH_O}, {NULL, NULL} }; @@ -2591,8 +2591,8 @@ static PyMethodDef bufferedwriter_methods[] = { _IO__BUFFERED_TELL_METHODDEF _IO__BUFFERED___SIZEOF___METHODDEF - {"__reduce__", _PyIOBase_cannot_pickle, METH_VARARGS}, - {"__reduce_ex__", _PyIOBase_cannot_pickle, METH_VARARGS}, + {"__reduce__", _PyIOBase_cannot_pickle, METH_NOARGS}, + {"__reduce_ex__", _PyIOBase_cannot_pickle, METH_O}, {NULL, NULL} }; @@ -2709,8 +2709,8 @@ static PyMethodDef bufferedrandom_methods[] = { _IO_BUFFEREDWRITER_WRITE_METHODDEF _IO__BUFFERED___SIZEOF___METHODDEF - {"__reduce__", _PyIOBase_cannot_pickle, METH_VARARGS}, - {"__reduce_ex__", _PyIOBase_cannot_pickle, METH_VARARGS}, + {"__reduce__", _PyIOBase_cannot_pickle, METH_NOARGS}, + {"__reduce_ex__", _PyIOBase_cannot_pickle, METH_O}, {NULL, NULL} }; diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c index 6bb156e..b5129ff 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -1178,8 +1178,8 @@ static PyMethodDef fileio_methods[] = { _IO_FILEIO_FILENO_METHODDEF _IO_FILEIO_ISATTY_METHODDEF {"_dealloc_warn", (PyCFunction)fileio_dealloc_warn, METH_O, NULL}, - {"__reduce__", _PyIOBase_cannot_pickle, METH_VARARGS}, - {"__reduce_ex__", _PyIOBase_cannot_pickle, METH_VARARGS}, + {"__reduce__", _PyIOBase_cannot_pickle, METH_NOARGS}, + {"__reduce_ex__", _PyIOBase_cannot_pickle, METH_O}, {NULL, NULL} /* sentinel */ }; diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index a3239ec..9dff8ea 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -3337,8 +3337,8 @@ static PyMethodDef textiowrapper_methods[] = { _IO_TEXTIOWRAPPER_TELL_METHODDEF _IO_TEXTIOWRAPPER_TRUNCATE_METHODDEF - {"__reduce__", _PyIOBase_cannot_pickle, METH_VARARGS}, - {"__reduce_ex__", _PyIOBase_cannot_pickle, METH_VARARGS}, + {"__reduce__", _PyIOBase_cannot_pickle, METH_NOARGS}, + {"__reduce_ex__", _PyIOBase_cannot_pickle, METH_O}, {NULL, NULL} }; |