summaryrefslogtreecommitdiffstats
path: root/Modules/_io/textio.c
diff options
context:
space:
mode:
authorErlend E. Aasland <erlend.aasland@protonmail.com>2023-05-15 11:21:38 (GMT)
committerGitHub <noreply@github.com>2023-05-15 11:21:38 (GMT)
commitb378d991f8cd41c33416e590cb83472cce1d6b98 (patch)
tree8f1bddd79f74a3af4a0e2d8d9608aed7a2e13f6f /Modules/_io/textio.c
parent186bf39f5c6003912e4f445430c504db51b9a743 (diff)
downloadcpython-b378d991f8cd41c33416e590cb83472cce1d6b98.zip
cpython-b378d991f8cd41c33416e590cb83472cce1d6b98.tar.gz
cpython-b378d991f8cd41c33416e590cb83472cce1d6b98.tar.bz2
gh-101819: Fix _io clinic input for unused base class method stubs (#104418)
When preparing the _io extension module for isolation, many methods were adapted to Argument Clinic. Some of these used the '*args: object' signature, which is incorrect. These are now corrected to an exact signature, and marked unused, since they are stub methods.
Diffstat (limited to 'Modules/_io/textio.c')
-rw-r--r--Modules/_io/textio.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
index 81dd3be..e858a1f 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -69,8 +69,8 @@ _io__TextIOBase_detach_impl(PyObject *self, PyTypeObject *cls)
/*[clinic input]
_io._TextIOBase.read
cls: defining_class
+ size: int(unused=True) = -1
/
- *args: object
Read at most size characters from stream.
@@ -79,8 +79,9 @@ If size is negative or omitted, read until EOF.
[clinic start generated code]*/
static PyObject *
-_io__TextIOBase_read_impl(PyObject *self, PyTypeObject *cls, PyObject *args)
-/*[clinic end generated code: output=3adf28998831f461 input=cee1e84664a20de0]*/
+_io__TextIOBase_read_impl(PyObject *self, PyTypeObject *cls,
+ int Py_UNUSED(size))
+/*[clinic end generated code: output=51a5178a309ce647 input=f5e37720f9fc563f]*/
{
_PyIO_State *state = get_io_state_by_cls(cls);
return _unsupported(state, "read");
@@ -89,18 +90,19 @@ _io__TextIOBase_read_impl(PyObject *self, PyTypeObject *cls, PyObject *args)
/*[clinic input]
_io._TextIOBase.readline
cls: defining_class
+ size: int(unused=True) = -1
/
- *args: object
Read until newline or EOF.
Return an empty string if EOF is hit immediately.
+If size is specified, at most size characters will be read.
[clinic start generated code]*/
static PyObject *
_io__TextIOBase_readline_impl(PyObject *self, PyTypeObject *cls,
- PyObject *args)
-/*[clinic end generated code: output=3073a948d02319f3 input=58f801259f7ff3ef]*/
+ int Py_UNUSED(size))
+/*[clinic end generated code: output=3f47d7966d6d074e input=42eafec94107fa27]*/
{
_PyIO_State *state = get_io_state_by_cls(cls);
return _unsupported(state, "readline");
@@ -109,18 +111,19 @@ _io__TextIOBase_readline_impl(PyObject *self, PyTypeObject *cls,
/*[clinic input]
_io._TextIOBase.write
cls: defining_class
+ s: str(unused=True)
/
- *args: object
-Write string to stream.
+Write string s to stream.
Return the number of characters written
(which is always equal to the length of the string).
[clinic start generated code]*/
static PyObject *
-_io__TextIOBase_write_impl(PyObject *self, PyTypeObject *cls, PyObject *args)
-/*[clinic end generated code: output=5d985eb529472bc4 input=21b6961b5cba9496]*/
+_io__TextIOBase_write_impl(PyObject *self, PyTypeObject *cls,
+ const char *Py_UNUSED(s))
+/*[clinic end generated code: output=18b28231460275de input=e9cabaa5f6732b07]*/
{
_PyIO_State *state = get_io_state_by_cls(cls);
return _unsupported(state, "write");