summaryrefslogtreecommitdiffstats
path: root/Modules/_io
diff options
context:
space:
mode:
authorDonghee Na <donghee.na@python.org>2023-12-20 12:52:12 (GMT)
committerGitHub <noreply@github.com>2023-12-20 12:52:12 (GMT)
commit57b7e52790ae56309832497a1ce17e3e731b920e (patch)
tree28fd9c7dcac2b8cdfd9497c950c4e8043b755b5f /Modules/_io
parent5a7cc667f816f0377f763322c2367301ea3379ee (diff)
downloadcpython-57b7e52790ae56309832497a1ce17e3e731b920e.zip
cpython-57b7e52790ae56309832497a1ce17e3e731b920e.tar.gz
cpython-57b7e52790ae56309832497a1ce17e3e731b920e.tar.bz2
gh-112205: Support docstring for `@getter` (#113160)
--------- Co-authored-by: Erlend E. Aasland <erlend@python.org>
Diffstat (limited to 'Modules/_io')
-rw-r--r--Modules/_io/clinic/bufferedio.c.h29
-rw-r--r--Modules/_io/clinic/stringio.c.h29
-rw-r--r--Modules/_io/clinic/textio.c.h137
-rw-r--r--Modules/_io/textio.c58
4 files changed, 204 insertions, 49 deletions
diff --git a/Modules/_io/clinic/bufferedio.c.h b/Modules/_io/clinic/bufferedio.c.h
index ec46d54..d5bec5f 100644
--- a/Modules/_io/clinic/bufferedio.c.h
+++ b/Modules/_io/clinic/bufferedio.c.h
@@ -327,11 +327,16 @@ _io__Buffered_simple_flush(buffered *self, PyObject *Py_UNUSED(ignored))
return return_value;
}
+#if defined(_io__Buffered_closed_HAS_DOCSTR)
+# define _io__Buffered_closed_DOCSTR _io__Buffered_closed__doc__
+#else
+# define _io__Buffered_closed_DOCSTR NULL
+#endif
#if defined(_IO__BUFFERED_CLOSED_GETSETDEF)
# undef _IO__BUFFERED_CLOSED_GETSETDEF
-# define _IO__BUFFERED_CLOSED_GETSETDEF {"closed", (getter)_io__Buffered_closed_get, (setter)_io__Buffered_closed_set, NULL},
+# define _IO__BUFFERED_CLOSED_GETSETDEF {"closed", (getter)_io__Buffered_closed_get, (setter)_io__Buffered_closed_set, _io__Buffered_closed_DOCSTR},
#else
-# define _IO__BUFFERED_CLOSED_GETSETDEF {"closed", (getter)_io__Buffered_closed_get, NULL, NULL},
+# define _IO__BUFFERED_CLOSED_GETSETDEF {"closed", (getter)_io__Buffered_closed_get, NULL, _io__Buffered_closed_DOCSTR},
#endif
static PyObject *
@@ -464,11 +469,16 @@ _io__Buffered_writable(buffered *self, PyObject *Py_UNUSED(ignored))
return return_value;
}
+#if defined(_io__Buffered_name_HAS_DOCSTR)
+# define _io__Buffered_name_DOCSTR _io__Buffered_name__doc__
+#else
+# define _io__Buffered_name_DOCSTR NULL
+#endif
#if defined(_IO__BUFFERED_NAME_GETSETDEF)
# undef _IO__BUFFERED_NAME_GETSETDEF
-# define _IO__BUFFERED_NAME_GETSETDEF {"name", (getter)_io__Buffered_name_get, (setter)_io__Buffered_name_set, NULL},
+# define _IO__BUFFERED_NAME_GETSETDEF {"name", (getter)_io__Buffered_name_get, (setter)_io__Buffered_name_set, _io__Buffered_name_DOCSTR},
#else
-# define _IO__BUFFERED_NAME_GETSETDEF {"name", (getter)_io__Buffered_name_get, NULL, NULL},
+# define _IO__BUFFERED_NAME_GETSETDEF {"name", (getter)_io__Buffered_name_get, NULL, _io__Buffered_name_DOCSTR},
#endif
static PyObject *
@@ -486,11 +496,16 @@ _io__Buffered_name_get(buffered *self, void *Py_UNUSED(context))
return return_value;
}
+#if defined(_io__Buffered_mode_HAS_DOCSTR)
+# define _io__Buffered_mode_DOCSTR _io__Buffered_mode__doc__
+#else
+# define _io__Buffered_mode_DOCSTR NULL
+#endif
#if defined(_IO__BUFFERED_MODE_GETSETDEF)
# undef _IO__BUFFERED_MODE_GETSETDEF
-# define _IO__BUFFERED_MODE_GETSETDEF {"mode", (getter)_io__Buffered_mode_get, (setter)_io__Buffered_mode_set, NULL},
+# define _IO__BUFFERED_MODE_GETSETDEF {"mode", (getter)_io__Buffered_mode_get, (setter)_io__Buffered_mode_set, _io__Buffered_mode_DOCSTR},
#else
-# define _IO__BUFFERED_MODE_GETSETDEF {"mode", (getter)_io__Buffered_mode_get, NULL, NULL},
+# define _IO__BUFFERED_MODE_GETSETDEF {"mode", (getter)_io__Buffered_mode_get, NULL, _io__Buffered_mode_DOCSTR},
#endif
static PyObject *
@@ -1230,4 +1245,4 @@ skip_optional_pos:
exit:
return return_value;
}
-/*[clinic end generated code: output=0999c33f666dc692 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=442b05b9a117df6c input=a9049054013a1b77]*/
diff --git a/Modules/_io/clinic/stringio.c.h b/Modules/_io/clinic/stringio.c.h
index fc2962d..6bdb218 100644
--- a/Modules/_io/clinic/stringio.c.h
+++ b/Modules/_io/clinic/stringio.c.h
@@ -475,11 +475,16 @@ _io_StringIO___setstate__(stringio *self, PyObject *state)
return return_value;
}
+#if defined(_io_StringIO_closed_HAS_DOCSTR)
+# define _io_StringIO_closed_DOCSTR _io_StringIO_closed__doc__
+#else
+# define _io_StringIO_closed_DOCSTR NULL
+#endif
#if defined(_IO_STRINGIO_CLOSED_GETSETDEF)
# undef _IO_STRINGIO_CLOSED_GETSETDEF
-# define _IO_STRINGIO_CLOSED_GETSETDEF {"closed", (getter)_io_StringIO_closed_get, (setter)_io_StringIO_closed_set, NULL},
+# define _IO_STRINGIO_CLOSED_GETSETDEF {"closed", (getter)_io_StringIO_closed_get, (setter)_io_StringIO_closed_set, _io_StringIO_closed_DOCSTR},
#else
-# define _IO_STRINGIO_CLOSED_GETSETDEF {"closed", (getter)_io_StringIO_closed_get, NULL, NULL},
+# define _IO_STRINGIO_CLOSED_GETSETDEF {"closed", (getter)_io_StringIO_closed_get, NULL, _io_StringIO_closed_DOCSTR},
#endif
static PyObject *
@@ -497,11 +502,16 @@ _io_StringIO_closed_get(stringio *self, void *Py_UNUSED(context))
return return_value;
}
+#if defined(_io_StringIO_line_buffering_HAS_DOCSTR)
+# define _io_StringIO_line_buffering_DOCSTR _io_StringIO_line_buffering__doc__
+#else
+# define _io_StringIO_line_buffering_DOCSTR NULL
+#endif
#if defined(_IO_STRINGIO_LINE_BUFFERING_GETSETDEF)
# undef _IO_STRINGIO_LINE_BUFFERING_GETSETDEF
-# define _IO_STRINGIO_LINE_BUFFERING_GETSETDEF {"line_buffering", (getter)_io_StringIO_line_buffering_get, (setter)_io_StringIO_line_buffering_set, NULL},
+# define _IO_STRINGIO_LINE_BUFFERING_GETSETDEF {"line_buffering", (getter)_io_StringIO_line_buffering_get, (setter)_io_StringIO_line_buffering_set, _io_StringIO_line_buffering_DOCSTR},
#else
-# define _IO_STRINGIO_LINE_BUFFERING_GETSETDEF {"line_buffering", (getter)_io_StringIO_line_buffering_get, NULL, NULL},
+# define _IO_STRINGIO_LINE_BUFFERING_GETSETDEF {"line_buffering", (getter)_io_StringIO_line_buffering_get, NULL, _io_StringIO_line_buffering_DOCSTR},
#endif
static PyObject *
@@ -519,11 +529,16 @@ _io_StringIO_line_buffering_get(stringio *self, void *Py_UNUSED(context))
return return_value;
}
+#if defined(_io_StringIO_newlines_HAS_DOCSTR)
+# define _io_StringIO_newlines_DOCSTR _io_StringIO_newlines__doc__
+#else
+# define _io_StringIO_newlines_DOCSTR NULL
+#endif
#if defined(_IO_STRINGIO_NEWLINES_GETSETDEF)
# undef _IO_STRINGIO_NEWLINES_GETSETDEF
-# define _IO_STRINGIO_NEWLINES_GETSETDEF {"newlines", (getter)_io_StringIO_newlines_get, (setter)_io_StringIO_newlines_set, NULL},
+# define _IO_STRINGIO_NEWLINES_GETSETDEF {"newlines", (getter)_io_StringIO_newlines_get, (setter)_io_StringIO_newlines_set, _io_StringIO_newlines_DOCSTR},
#else
-# define _IO_STRINGIO_NEWLINES_GETSETDEF {"newlines", (getter)_io_StringIO_newlines_get, NULL, NULL},
+# define _IO_STRINGIO_NEWLINES_GETSETDEF {"newlines", (getter)_io_StringIO_newlines_get, NULL, _io_StringIO_newlines_DOCSTR},
#endif
static PyObject *
@@ -540,4 +555,4 @@ _io_StringIO_newlines_get(stringio *self, void *Py_UNUSED(context))
return return_value;
}
-/*[clinic end generated code: output=27726751d98ab617 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=9ffea20cd32d4cd8 input=a9049054013a1b77]*/
diff --git a/Modules/_io/clinic/textio.c.h b/Modules/_io/clinic/textio.c.h
index f24f65f..23b3cc8 100644
--- a/Modules/_io/clinic/textio.c.h
+++ b/Modules/_io/clinic/textio.c.h
@@ -201,6 +201,89 @@ exit:
return return_value;
}
+PyDoc_STRVAR(_io__TextIOBase_encoding__doc__,
+"Encoding of the text stream.\n"
+"\n"
+"Subclasses should override.");
+#define _io__TextIOBase_encoding_HAS_DOCSTR
+
+#if defined(_io__TextIOBase_encoding_HAS_DOCSTR)
+# define _io__TextIOBase_encoding_DOCSTR _io__TextIOBase_encoding__doc__
+#else
+# define _io__TextIOBase_encoding_DOCSTR NULL
+#endif
+#if defined(_IO__TEXTIOBASE_ENCODING_GETSETDEF)
+# undef _IO__TEXTIOBASE_ENCODING_GETSETDEF
+# define _IO__TEXTIOBASE_ENCODING_GETSETDEF {"encoding", (getter)_io__TextIOBase_encoding_get, (setter)_io__TextIOBase_encoding_set, _io__TextIOBase_encoding_DOCSTR},
+#else
+# define _IO__TEXTIOBASE_ENCODING_GETSETDEF {"encoding", (getter)_io__TextIOBase_encoding_get, NULL, _io__TextIOBase_encoding_DOCSTR},
+#endif
+
+static PyObject *
+_io__TextIOBase_encoding_get_impl(PyObject *self);
+
+static PyObject *
+_io__TextIOBase_encoding_get(PyObject *self, void *Py_UNUSED(context))
+{
+ return _io__TextIOBase_encoding_get_impl(self);
+}
+
+PyDoc_STRVAR(_io__TextIOBase_newlines__doc__,
+"Line endings translated so far.\n"
+"\n"
+"Only line endings translated during reading are considered.\n"
+"\n"
+"Subclasses should override.");
+#define _io__TextIOBase_newlines_HAS_DOCSTR
+
+#if defined(_io__TextIOBase_newlines_HAS_DOCSTR)
+# define _io__TextIOBase_newlines_DOCSTR _io__TextIOBase_newlines__doc__
+#else
+# define _io__TextIOBase_newlines_DOCSTR NULL
+#endif
+#if defined(_IO__TEXTIOBASE_NEWLINES_GETSETDEF)
+# undef _IO__TEXTIOBASE_NEWLINES_GETSETDEF
+# define _IO__TEXTIOBASE_NEWLINES_GETSETDEF {"newlines", (getter)_io__TextIOBase_newlines_get, (setter)_io__TextIOBase_newlines_set, _io__TextIOBase_newlines_DOCSTR},
+#else
+# define _IO__TEXTIOBASE_NEWLINES_GETSETDEF {"newlines", (getter)_io__TextIOBase_newlines_get, NULL, _io__TextIOBase_newlines_DOCSTR},
+#endif
+
+static PyObject *
+_io__TextIOBase_newlines_get_impl(PyObject *self);
+
+static PyObject *
+_io__TextIOBase_newlines_get(PyObject *self, void *Py_UNUSED(context))
+{
+ return _io__TextIOBase_newlines_get_impl(self);
+}
+
+PyDoc_STRVAR(_io__TextIOBase_errors__doc__,
+"The error setting of the decoder or encoder.\n"
+"\n"
+"Subclasses should override.");
+#define _io__TextIOBase_errors_HAS_DOCSTR
+
+#if defined(_io__TextIOBase_errors_HAS_DOCSTR)
+# define _io__TextIOBase_errors_DOCSTR _io__TextIOBase_errors__doc__
+#else
+# define _io__TextIOBase_errors_DOCSTR NULL
+#endif
+#if defined(_IO__TEXTIOBASE_ERRORS_GETSETDEF)
+# undef _IO__TEXTIOBASE_ERRORS_GETSETDEF
+# define _IO__TEXTIOBASE_ERRORS_GETSETDEF {"errors", (getter)_io__TextIOBase_errors_get, (setter)_io__TextIOBase_errors_set, _io__TextIOBase_errors_DOCSTR},
+#else
+# define _IO__TEXTIOBASE_ERRORS_GETSETDEF {"errors", (getter)_io__TextIOBase_errors_get, NULL, _io__TextIOBase_errors_DOCSTR},
+#endif
+
+static PyObject *
+_io__TextIOBase_errors_get_impl(PyObject *self);
+
+static PyObject *
+_io__TextIOBase_errors_get(PyObject *self, void *Py_UNUSED(context))
+{
+ return _io__TextIOBase_errors_get_impl(self);
+}
+
PyDoc_STRVAR(_io_IncrementalNewlineDecoder___init____doc__,
"IncrementalNewlineDecoder(decoder, translate, errors=\'strict\')\n"
"--\n"
@@ -1048,11 +1131,16 @@ _io_TextIOWrapper_close(textio *self, PyObject *Py_UNUSED(ignored))
return return_value;
}
+#if defined(_io_TextIOWrapper_name_HAS_DOCSTR)
+# define _io_TextIOWrapper_name_DOCSTR _io_TextIOWrapper_name__doc__
+#else
+# define _io_TextIOWrapper_name_DOCSTR NULL
+#endif
#if defined(_IO_TEXTIOWRAPPER_NAME_GETSETDEF)
# undef _IO_TEXTIOWRAPPER_NAME_GETSETDEF
-# define _IO_TEXTIOWRAPPER_NAME_GETSETDEF {"name", (getter)_io_TextIOWrapper_name_get, (setter)_io_TextIOWrapper_name_set, NULL},
+# define _IO_TEXTIOWRAPPER_NAME_GETSETDEF {"name", (getter)_io_TextIOWrapper_name_get, (setter)_io_TextIOWrapper_name_set, _io_TextIOWrapper_name_DOCSTR},
#else
-# define _IO_TEXTIOWRAPPER_NAME_GETSETDEF {"name", (getter)_io_TextIOWrapper_name_get, NULL, NULL},
+# define _IO_TEXTIOWRAPPER_NAME_GETSETDEF {"name", (getter)_io_TextIOWrapper_name_get, NULL, _io_TextIOWrapper_name_DOCSTR},
#endif
static PyObject *
@@ -1070,11 +1158,16 @@ _io_TextIOWrapper_name_get(textio *self, void *Py_UNUSED(context))
return return_value;
}
+#if defined(_io_TextIOWrapper_closed_HAS_DOCSTR)
+# define _io_TextIOWrapper_closed_DOCSTR _io_TextIOWrapper_closed__doc__
+#else
+# define _io_TextIOWrapper_closed_DOCSTR NULL
+#endif
#if defined(_IO_TEXTIOWRAPPER_CLOSED_GETSETDEF)
# undef _IO_TEXTIOWRAPPER_CLOSED_GETSETDEF
-# define _IO_TEXTIOWRAPPER_CLOSED_GETSETDEF {"closed", (getter)_io_TextIOWrapper_closed_get, (setter)_io_TextIOWrapper_closed_set, NULL},
+# define _IO_TEXTIOWRAPPER_CLOSED_GETSETDEF {"closed", (getter)_io_TextIOWrapper_closed_get, (setter)_io_TextIOWrapper_closed_set, _io_TextIOWrapper_closed_DOCSTR},
#else
-# define _IO_TEXTIOWRAPPER_CLOSED_GETSETDEF {"closed", (getter)_io_TextIOWrapper_closed_get, NULL, NULL},
+# define _IO_TEXTIOWRAPPER_CLOSED_GETSETDEF {"closed", (getter)_io_TextIOWrapper_closed_get, NULL, _io_TextIOWrapper_closed_DOCSTR},
#endif
static PyObject *
@@ -1092,11 +1185,16 @@ _io_TextIOWrapper_closed_get(textio *self, void *Py_UNUSED(context))
return return_value;
}
+#if defined(_io_TextIOWrapper_newlines_HAS_DOCSTR)
+# define _io_TextIOWrapper_newlines_DOCSTR _io_TextIOWrapper_newlines__doc__
+#else
+# define _io_TextIOWrapper_newlines_DOCSTR NULL
+#endif
#if defined(_IO_TEXTIOWRAPPER_NEWLINES_GETSETDEF)
# undef _IO_TEXTIOWRAPPER_NEWLINES_GETSETDEF
-# define _IO_TEXTIOWRAPPER_NEWLINES_GETSETDEF {"newlines", (getter)_io_TextIOWrapper_newlines_get, (setter)_io_TextIOWrapper_newlines_set, NULL},
+# define _IO_TEXTIOWRAPPER_NEWLINES_GETSETDEF {"newlines", (getter)_io_TextIOWrapper_newlines_get, (setter)_io_TextIOWrapper_newlines_set, _io_TextIOWrapper_newlines_DOCSTR},
#else
-# define _IO_TEXTIOWRAPPER_NEWLINES_GETSETDEF {"newlines", (getter)_io_TextIOWrapper_newlines_get, NULL, NULL},
+# define _IO_TEXTIOWRAPPER_NEWLINES_GETSETDEF {"newlines", (getter)_io_TextIOWrapper_newlines_get, NULL, _io_TextIOWrapper_newlines_DOCSTR},
#endif
static PyObject *
@@ -1114,11 +1212,16 @@ _io_TextIOWrapper_newlines_get(textio *self, void *Py_UNUSED(context))
return return_value;
}
+#if defined(_io_TextIOWrapper_errors_HAS_DOCSTR)
+# define _io_TextIOWrapper_errors_DOCSTR _io_TextIOWrapper_errors__doc__
+#else
+# define _io_TextIOWrapper_errors_DOCSTR NULL
+#endif
#if defined(_IO_TEXTIOWRAPPER_ERRORS_GETSETDEF)
# undef _IO_TEXTIOWRAPPER_ERRORS_GETSETDEF
-# define _IO_TEXTIOWRAPPER_ERRORS_GETSETDEF {"errors", (getter)_io_TextIOWrapper_errors_get, (setter)_io_TextIOWrapper_errors_set, NULL},
+# define _IO_TEXTIOWRAPPER_ERRORS_GETSETDEF {"errors", (getter)_io_TextIOWrapper_errors_get, (setter)_io_TextIOWrapper_errors_set, _io_TextIOWrapper_errors_DOCSTR},
#else
-# define _IO_TEXTIOWRAPPER_ERRORS_GETSETDEF {"errors", (getter)_io_TextIOWrapper_errors_get, NULL, NULL},
+# define _IO_TEXTIOWRAPPER_ERRORS_GETSETDEF {"errors", (getter)_io_TextIOWrapper_errors_get, NULL, _io_TextIOWrapper_errors_DOCSTR},
#endif
static PyObject *
@@ -1136,11 +1239,16 @@ _io_TextIOWrapper_errors_get(textio *self, void *Py_UNUSED(context))
return return_value;
}
+#if defined(_io_TextIOWrapper__CHUNK_SIZE_HAS_DOCSTR)
+# define _io_TextIOWrapper__CHUNK_SIZE_DOCSTR _io_TextIOWrapper__CHUNK_SIZE__doc__
+#else
+# define _io_TextIOWrapper__CHUNK_SIZE_DOCSTR NULL
+#endif
#if defined(_IO_TEXTIOWRAPPER__CHUNK_SIZE_GETSETDEF)
# undef _IO_TEXTIOWRAPPER__CHUNK_SIZE_GETSETDEF
-# define _IO_TEXTIOWRAPPER__CHUNK_SIZE_GETSETDEF {"_CHUNK_SIZE", (getter)_io_TextIOWrapper__CHUNK_SIZE_get, (setter)_io_TextIOWrapper__CHUNK_SIZE_set, NULL},
+# define _IO_TEXTIOWRAPPER__CHUNK_SIZE_GETSETDEF {"_CHUNK_SIZE", (getter)_io_TextIOWrapper__CHUNK_SIZE_get, (setter)_io_TextIOWrapper__CHUNK_SIZE_set, _io_TextIOWrapper__CHUNK_SIZE_DOCSTR},
#else
-# define _IO_TEXTIOWRAPPER__CHUNK_SIZE_GETSETDEF {"_CHUNK_SIZE", (getter)_io_TextIOWrapper__CHUNK_SIZE_get, NULL, NULL},
+# define _IO_TEXTIOWRAPPER__CHUNK_SIZE_GETSETDEF {"_CHUNK_SIZE", (getter)_io_TextIOWrapper__CHUNK_SIZE_get, NULL, _io_TextIOWrapper__CHUNK_SIZE_DOCSTR},
#endif
static PyObject *
@@ -1158,9 +1266,14 @@ _io_TextIOWrapper__CHUNK_SIZE_get(textio *self, void *Py_UNUSED(context))
return return_value;
}
+#if defined(_IO_TEXTIOWRAPPER__CHUNK_SIZE_HAS_DOCSTR)
+# define _io_TextIOWrapper__CHUNK_SIZE_DOCSTR _io_TextIOWrapper__CHUNK_SIZE__doc__
+#else
+# define _io_TextIOWrapper__CHUNK_SIZE_DOCSTR NULL
+#endif
#if defined(_IO_TEXTIOWRAPPER__CHUNK_SIZE_GETSETDEF)
# undef _IO_TEXTIOWRAPPER__CHUNK_SIZE_GETSETDEF
-# define _IO_TEXTIOWRAPPER__CHUNK_SIZE_GETSETDEF {"_CHUNK_SIZE", (getter)_io_TextIOWrapper__CHUNK_SIZE_get, (setter)_io_TextIOWrapper__CHUNK_SIZE_set, NULL},
+# define _IO_TEXTIOWRAPPER__CHUNK_SIZE_GETSETDEF {"_CHUNK_SIZE", (getter)_io_TextIOWrapper__CHUNK_SIZE_get, (setter)_io_TextIOWrapper__CHUNK_SIZE_set, _io_TextIOWrapper__CHUNK_SIZE_DOCSTR},
#else
# define _IO_TEXTIOWRAPPER__CHUNK_SIZE_GETSETDEF {"_CHUNK_SIZE", NULL, (setter)_io_TextIOWrapper__CHUNK_SIZE_set, NULL},
#endif
@@ -1179,4 +1292,4 @@ _io_TextIOWrapper__CHUNK_SIZE_set(textio *self, PyObject *value, void *Py_UNUSED
return return_value;
}
-/*[clinic end generated code: output=7af87bf848a5d3f3 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d01aa598647c1385 input=a9049054013a1b77]*/
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
index 702336c..4507930 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -131,40 +131,52 @@ _io__TextIOBase_write_impl(PyObject *self, PyTypeObject *cls,
return _unsupported(state, "write");
}
-PyDoc_STRVAR(textiobase_encoding_doc,
- "Encoding of the text stream.\n"
- "\n"
- "Subclasses should override.\n"
- );
+/*[clinic input]
+@getter
+_io._TextIOBase.encoding
+
+Encoding of the text stream.
+
+Subclasses should override.
+[clinic start generated code]*/
static PyObject *
-textiobase_encoding_get(PyObject *self, void *context)
+_io__TextIOBase_encoding_get_impl(PyObject *self)
+/*[clinic end generated code: output=e0f5d8f548b92432 input=4736d7621dd38f43]*/
{
Py_RETURN_NONE;
}
-PyDoc_STRVAR(textiobase_newlines_doc,
- "Line endings translated so far.\n"
- "\n"
- "Only line endings translated during reading are considered.\n"
- "\n"
- "Subclasses should override.\n"
- );
+/*[clinic input]
+@getter
+_io._TextIOBase.newlines
+
+Line endings translated so far.
+
+Only line endings translated during reading are considered.
+
+Subclasses should override.
+[clinic start generated code]*/
static PyObject *
-textiobase_newlines_get(PyObject *self, void *context)
+_io__TextIOBase_newlines_get_impl(PyObject *self)
+/*[clinic end generated code: output=46ec147fb9f00c2a input=a5b196d076af1164]*/
{
Py_RETURN_NONE;
}
-PyDoc_STRVAR(textiobase_errors_doc,
- "The error setting of the decoder or encoder.\n"
- "\n"
- "Subclasses should override.\n"
- );
+/*[clinic input]
+@getter
+_io._TextIOBase.errors
+
+The error setting of the decoder or encoder.
+
+Subclasses should override.
+[clinic start generated code]*/
static PyObject *
-textiobase_errors_get(PyObject *self, void *context)
+_io__TextIOBase_errors_get_impl(PyObject *self)
+/*[clinic end generated code: output=c6623d6addcd087d input=974aa52d1db93a82]*/
{
Py_RETURN_NONE;
}
@@ -179,9 +191,9 @@ static PyMethodDef textiobase_methods[] = {
};
static PyGetSetDef textiobase_getset[] = {
- {"encoding", (getter)textiobase_encoding_get, NULL, textiobase_encoding_doc},
- {"newlines", (getter)textiobase_newlines_get, NULL, textiobase_newlines_doc},
- {"errors", (getter)textiobase_errors_get, NULL, textiobase_errors_doc},
+ _IO__TEXTIOBASE_ENCODING_GETSETDEF
+ _IO__TEXTIOBASE_NEWLINES_GETSETDEF
+ _IO__TEXTIOBASE_ERRORS_GETSETDEF
{NULL}
};