#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
# include "pycore_gc.h"
# include "pycore_runtime.h"
#endif
#include "pycore_abstract.h"
#include "pycore_critical_section.h"
#include "pycore_modsupport.h"
PyDoc_STRVAR(_io__TextIOBase_detach__doc__,
"detach($self, /)\n"
"--\n"
"\n"
"Separate the underlying buffer from the TextIOBase and return it.\n"
"\n"
"After the underlying buffer has been detached, the TextIO is in an unusable state.");
#define _IO__TEXTIOBASE_DETACH_METHODDEF …
static PyObject *
_io__TextIOBase_detach_impl(PyObject *self, PyTypeObject *cls);
static PyObject *
_io__TextIOBase_detach(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{ … }
PyDoc_STRVAR(_io__TextIOBase_read__doc__,
"read($self, size=-1, /)\n"
"--\n"
"\n"
"Read at most size characters from stream.\n"
"\n"
"Read from underlying buffer until we have size characters or we hit EOF.\n"
"If size is negative or omitted, read until EOF.");
#define _IO__TEXTIOBASE_READ_METHODDEF …
static PyObject *
_io__TextIOBase_read_impl(PyObject *self, PyTypeObject *cls,
int Py_UNUSED(size));
static PyObject *
_io__TextIOBase_read(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{ … }
PyDoc_STRVAR(_io__TextIOBase_readline__doc__,
"readline($self, size=-1, /)\n"
"--\n"
"\n"
"Read until newline or EOF.\n"
"\n"
"Return an empty string if EOF is hit immediately.\n"
"If size is specified, at most size characters will be read.");
#define _IO__TEXTIOBASE_READLINE_METHODDEF …
static PyObject *
_io__TextIOBase_readline_impl(PyObject *self, PyTypeObject *cls,
int Py_UNUSED(size));
static PyObject *
_io__TextIOBase_readline(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{ … }
PyDoc_STRVAR(_io__TextIOBase_write__doc__,
"write($self, s, /)\n"
"--\n"
"\n"
"Write string s to stream.\n"
"\n"
"Return the number of characters written\n"
"(which is always equal to the length of the string).");
#define _IO__TEXTIOBASE_WRITE_METHODDEF …
static PyObject *
_io__TextIOBase_write_impl(PyObject *self, PyTypeObject *cls,
const char *Py_UNUSED(s));
static PyObject *
_io__TextIOBase_write(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{ … }
PyDoc_STRVAR(_io__TextIOBase_encoding__doc__,
"Encoding of the text stream.\n"
"\n"
"Subclasses should override.");
#define _io__TextIOBase_encoding_DOCSTR …
#if !defined(_io__TextIOBase_encoding_DOCSTR)
#define _io__TextIOBase_encoding_DOCSTR …
#endif
#if defined(_IO__TEXTIOBASE_ENCODING_GETSETDEF)
# undef _IO__TEXTIOBASE_ENCODING_GETSETDEF
#define _IO__TEXTIOBASE_ENCODING_GETSETDEF …
#else
#define _IO__TEXTIOBASE_ENCODING_GETSETDEF …
#endif
static PyObject *
_io__TextIOBase_encoding_get_impl(PyObject *self);
static PyObject *
_io__TextIOBase_encoding_get(PyObject *self, void *Py_UNUSED(context))
{ … }
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_DOCSTR …
#if !defined(_io__TextIOBase_newlines_DOCSTR)
#define _io__TextIOBase_newlines_DOCSTR …
#endif
#if defined(_IO__TEXTIOBASE_NEWLINES_GETSETDEF)
# undef _IO__TEXTIOBASE_NEWLINES_GETSETDEF
#define _IO__TEXTIOBASE_NEWLINES_GETSETDEF …
#else
#define _IO__TEXTIOBASE_NEWLINES_GETSETDEF …
#endif
static PyObject *
_io__TextIOBase_newlines_get_impl(PyObject *self);
static PyObject *
_io__TextIOBase_newlines_get(PyObject *self, void *Py_UNUSED(context))
{ … }
PyDoc_STRVAR(_io__TextIOBase_errors__doc__,
"The error setting of the decoder or encoder.\n"
"\n"
"Subclasses should override.");
#define _io__TextIOBase_errors_DOCSTR …
#if !defined(_io__TextIOBase_errors_DOCSTR)
#define _io__TextIOBase_errors_DOCSTR …
#endif
#if defined(_IO__TEXTIOBASE_ERRORS_GETSETDEF)
# undef _IO__TEXTIOBASE_ERRORS_GETSETDEF
#define _IO__TEXTIOBASE_ERRORS_GETSETDEF …
#else
#define _IO__TEXTIOBASE_ERRORS_GETSETDEF …
#endif
static PyObject *
_io__TextIOBase_errors_get_impl(PyObject *self);
static PyObject *
_io__TextIOBase_errors_get(PyObject *self, void *Py_UNUSED(context))
{ … }
PyDoc_STRVAR(_io_IncrementalNewlineDecoder___init____doc__,
"IncrementalNewlineDecoder(decoder, translate, errors=\'strict\')\n"
"--\n"
"\n"
"Codec used when reading a file in universal newlines mode.\n"
"\n"
"It wraps another incremental decoder, translating \\r\\n and \\r into \\n.\n"
"It also records the types of newlines encountered. When used with\n"
"translate=False, it ensures that the newline sequence is returned in\n"
"one piece. When used with decoder=None, it expects unicode strings as\n"
"decode input and translates newlines without first invoking an external\n"
"decoder.");
static int
_io_IncrementalNewlineDecoder___init___impl(nldecoder_object *self,
PyObject *decoder, int translate,
PyObject *errors);
static int
_io_IncrementalNewlineDecoder___init__(PyObject *self, PyObject *args, PyObject *kwargs)
{ … }
PyDoc_STRVAR(_io_IncrementalNewlineDecoder_decode__doc__,
"decode($self, /, input, final=False)\n"
"--\n"
"\n");
#define _IO_INCREMENTALNEWLINEDECODER_DECODE_METHODDEF …
static PyObject *
_io_IncrementalNewlineDecoder_decode_impl(nldecoder_object *self,
PyObject *input, int final);
static PyObject *
_io_IncrementalNewlineDecoder_decode(nldecoder_object *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{ … }
PyDoc_STRVAR(_io_IncrementalNewlineDecoder_getstate__doc__,
"getstate($self, /)\n"
"--\n"
"\n");
#define _IO_INCREMENTALNEWLINEDECODER_GETSTATE_METHODDEF …
static PyObject *
_io_IncrementalNewlineDecoder_getstate_impl(nldecoder_object *self);
static PyObject *
_io_IncrementalNewlineDecoder_getstate(nldecoder_object *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(_io_IncrementalNewlineDecoder_setstate__doc__,
"setstate($self, state, /)\n"
"--\n"
"\n");
#define _IO_INCREMENTALNEWLINEDECODER_SETSTATE_METHODDEF …
PyDoc_STRVAR(_io_IncrementalNewlineDecoder_reset__doc__,
"reset($self, /)\n"
"--\n"
"\n");
#define _IO_INCREMENTALNEWLINEDECODER_RESET_METHODDEF …
static PyObject *
_io_IncrementalNewlineDecoder_reset_impl(nldecoder_object *self);
static PyObject *
_io_IncrementalNewlineDecoder_reset(nldecoder_object *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(_io_TextIOWrapper___init____doc__,
"TextIOWrapper(buffer, encoding=None, errors=None, newline=None,\n"
" line_buffering=False, write_through=False)\n"
"--\n"
"\n"
"Character and line based layer over a BufferedIOBase object, buffer.\n"
"\n"
"encoding gives the name of the encoding that the stream will be\n"
"decoded or encoded with. It defaults to locale.getencoding().\n"
"\n"
"errors determines the strictness of encoding and decoding (see\n"
"help(codecs.Codec) or the documentation for codecs.register) and\n"
"defaults to \"strict\".\n"
"\n"
"newline controls how line endings are handled. It can be None, \'\',\n"
"\'\\n\', \'\\r\', and \'\\r\\n\'. It works as follows:\n"
"\n"
"* On input, if newline is None, universal newlines mode is\n"
" enabled. Lines in the input can end in \'\\n\', \'\\r\', or \'\\r\\n\', and\n"
" these are translated into \'\\n\' before being returned to the\n"
" caller. If it is \'\', universal newline mode is enabled, but line\n"
" endings are returned to the caller untranslated. If it has any of\n"
" the other legal values, input lines are only terminated by the given\n"
" string, and the line ending is returned to the caller untranslated.\n"
"\n"
"* On output, if newline is None, any \'\\n\' characters written are\n"
" translated to the system default line separator, os.linesep. If\n"
" newline is \'\' or \'\\n\', no translation takes place. If newline is any\n"
" of the other legal values, any \'\\n\' characters written are translated\n"
" to the given string.\n"
"\n"
"If line_buffering is True, a call to flush is implied when a call to\n"
"write contains a newline character.");
static int
_io_TextIOWrapper___init___impl(textio *self, PyObject *buffer,
const char *encoding, PyObject *errors,
const char *newline, int line_buffering,
int write_through);
static int
_io_TextIOWrapper___init__(PyObject *self, PyObject *args, PyObject *kwargs)
{ … }
PyDoc_STRVAR(_io_TextIOWrapper_reconfigure__doc__,
"reconfigure($self, /, *, encoding=None, errors=None, newline=None,\n"
" line_buffering=None, write_through=None)\n"
"--\n"
"\n"
"Reconfigure the text stream with new parameters.\n"
"\n"
"This also does an implicit stream flush.");
#define _IO_TEXTIOWRAPPER_RECONFIGURE_METHODDEF …
static PyObject *
_io_TextIOWrapper_reconfigure_impl(textio *self, PyObject *encoding,
PyObject *errors, PyObject *newline_obj,
PyObject *line_buffering_obj,
PyObject *write_through_obj);
static PyObject *
_io_TextIOWrapper_reconfigure(textio *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{ … }
PyDoc_STRVAR(_io_TextIOWrapper_detach__doc__,
"detach($self, /)\n"
"--\n"
"\n");
#define _IO_TEXTIOWRAPPER_DETACH_METHODDEF …
static PyObject *
_io_TextIOWrapper_detach_impl(textio *self);
static PyObject *
_io_TextIOWrapper_detach(textio *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(_io_TextIOWrapper_write__doc__,
"write($self, text, /)\n"
"--\n"
"\n");
#define _IO_TEXTIOWRAPPER_WRITE_METHODDEF …
static PyObject *
_io_TextIOWrapper_write_impl(textio *self, PyObject *text);
static PyObject *
_io_TextIOWrapper_write(textio *self, PyObject *arg)
{ … }
PyDoc_STRVAR(_io_TextIOWrapper_read__doc__,
"read($self, size=-1, /)\n"
"--\n"
"\n");
#define _IO_TEXTIOWRAPPER_READ_METHODDEF …
static PyObject *
_io_TextIOWrapper_read_impl(textio *self, Py_ssize_t n);
static PyObject *
_io_TextIOWrapper_read(textio *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(_io_TextIOWrapper_readline__doc__,
"readline($self, size=-1, /)\n"
"--\n"
"\n");
#define _IO_TEXTIOWRAPPER_READLINE_METHODDEF …
static PyObject *
_io_TextIOWrapper_readline_impl(textio *self, Py_ssize_t size);
static PyObject *
_io_TextIOWrapper_readline(textio *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(_io_TextIOWrapper_seek__doc__,
"seek($self, cookie, whence=os.SEEK_SET, /)\n"
"--\n"
"\n"
"Set the stream position, and return the new stream position.\n"
"\n"
" cookie\n"
" Zero or an opaque number returned by tell().\n"
" whence\n"
" The relative position to seek from.\n"
"\n"
"Four operations are supported, given by the following argument\n"
"combinations:\n"
"\n"
"- seek(0, SEEK_SET): Rewind to the start of the stream.\n"
"- seek(cookie, SEEK_SET): Restore a previous position;\n"
" \'cookie\' must be a number returned by tell().\n"
"- seek(0, SEEK_END): Fast-forward to the end of the stream.\n"
"- seek(0, SEEK_CUR): Leave the current stream position unchanged.\n"
"\n"
"Any other argument combinations are invalid,\n"
"and may raise exceptions.");
#define _IO_TEXTIOWRAPPER_SEEK_METHODDEF …
static PyObject *
_io_TextIOWrapper_seek_impl(textio *self, PyObject *cookieObj, int whence);
static PyObject *
_io_TextIOWrapper_seek(textio *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(_io_TextIOWrapper_tell__doc__,
"tell($self, /)\n"
"--\n"
"\n"
"Return the stream position as an opaque number.\n"
"\n"
"The return value of tell() can be given as input to seek(), to restore a\n"
"previous stream position.");
#define _IO_TEXTIOWRAPPER_TELL_METHODDEF …
static PyObject *
_io_TextIOWrapper_tell_impl(textio *self);
static PyObject *
_io_TextIOWrapper_tell(textio *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(_io_TextIOWrapper_truncate__doc__,
"truncate($self, pos=None, /)\n"
"--\n"
"\n");
#define _IO_TEXTIOWRAPPER_TRUNCATE_METHODDEF …
static PyObject *
_io_TextIOWrapper_truncate_impl(textio *self, PyObject *pos);
static PyObject *
_io_TextIOWrapper_truncate(textio *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(_io_TextIOWrapper_fileno__doc__,
"fileno($self, /)\n"
"--\n"
"\n");
#define _IO_TEXTIOWRAPPER_FILENO_METHODDEF …
static PyObject *
_io_TextIOWrapper_fileno_impl(textio *self);
static PyObject *
_io_TextIOWrapper_fileno(textio *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(_io_TextIOWrapper_seekable__doc__,
"seekable($self, /)\n"
"--\n"
"\n");
#define _IO_TEXTIOWRAPPER_SEEKABLE_METHODDEF …
static PyObject *
_io_TextIOWrapper_seekable_impl(textio *self);
static PyObject *
_io_TextIOWrapper_seekable(textio *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(_io_TextIOWrapper_readable__doc__,
"readable($self, /)\n"
"--\n"
"\n");
#define _IO_TEXTIOWRAPPER_READABLE_METHODDEF …
static PyObject *
_io_TextIOWrapper_readable_impl(textio *self);
static PyObject *
_io_TextIOWrapper_readable(textio *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(_io_TextIOWrapper_writable__doc__,
"writable($self, /)\n"
"--\n"
"\n");
#define _IO_TEXTIOWRAPPER_WRITABLE_METHODDEF …
static PyObject *
_io_TextIOWrapper_writable_impl(textio *self);
static PyObject *
_io_TextIOWrapper_writable(textio *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(_io_TextIOWrapper_isatty__doc__,
"isatty($self, /)\n"
"--\n"
"\n");
#define _IO_TEXTIOWRAPPER_ISATTY_METHODDEF …
static PyObject *
_io_TextIOWrapper_isatty_impl(textio *self);
static PyObject *
_io_TextIOWrapper_isatty(textio *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(_io_TextIOWrapper_flush__doc__,
"flush($self, /)\n"
"--\n"
"\n");
#define _IO_TEXTIOWRAPPER_FLUSH_METHODDEF …
static PyObject *
_io_TextIOWrapper_flush_impl(textio *self);
static PyObject *
_io_TextIOWrapper_flush(textio *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(_io_TextIOWrapper_close__doc__,
"close($self, /)\n"
"--\n"
"\n");
#define _IO_TEXTIOWRAPPER_CLOSE_METHODDEF …
static PyObject *
_io_TextIOWrapper_close_impl(textio *self);
static PyObject *
_io_TextIOWrapper_close(textio *self, PyObject *Py_UNUSED(ignored))
{ … }
#if !defined(_io_TextIOWrapper_name_DOCSTR)
#define _io_TextIOWrapper_name_DOCSTR …
#endif
#if defined(_IO_TEXTIOWRAPPER_NAME_GETSETDEF)
# undef _IO_TEXTIOWRAPPER_NAME_GETSETDEF
#define _IO_TEXTIOWRAPPER_NAME_GETSETDEF …
#else
#define _IO_TEXTIOWRAPPER_NAME_GETSETDEF …
#endif
static PyObject *
_io_TextIOWrapper_name_get_impl(textio *self);
static PyObject *
_io_TextIOWrapper_name_get(textio *self, void *Py_UNUSED(context))
{ … }
#if !defined(_io_TextIOWrapper_closed_DOCSTR)
#define _io_TextIOWrapper_closed_DOCSTR …
#endif
#if defined(_IO_TEXTIOWRAPPER_CLOSED_GETSETDEF)
# undef _IO_TEXTIOWRAPPER_CLOSED_GETSETDEF
#define _IO_TEXTIOWRAPPER_CLOSED_GETSETDEF …
#else
#define _IO_TEXTIOWRAPPER_CLOSED_GETSETDEF …
#endif
static PyObject *
_io_TextIOWrapper_closed_get_impl(textio *self);
static PyObject *
_io_TextIOWrapper_closed_get(textio *self, void *Py_UNUSED(context))
{ … }
#if !defined(_io_TextIOWrapper_newlines_DOCSTR)
#define _io_TextIOWrapper_newlines_DOCSTR …
#endif
#if defined(_IO_TEXTIOWRAPPER_NEWLINES_GETSETDEF)
# undef _IO_TEXTIOWRAPPER_NEWLINES_GETSETDEF
#define _IO_TEXTIOWRAPPER_NEWLINES_GETSETDEF …
#else
#define _IO_TEXTIOWRAPPER_NEWLINES_GETSETDEF …
#endif
static PyObject *
_io_TextIOWrapper_newlines_get_impl(textio *self);
static PyObject *
_io_TextIOWrapper_newlines_get(textio *self, void *Py_UNUSED(context))
{ … }
#if !defined(_io_TextIOWrapper_errors_DOCSTR)
#define _io_TextIOWrapper_errors_DOCSTR …
#endif
#if defined(_IO_TEXTIOWRAPPER_ERRORS_GETSETDEF)
# undef _IO_TEXTIOWRAPPER_ERRORS_GETSETDEF
#define _IO_TEXTIOWRAPPER_ERRORS_GETSETDEF …
#else
#define _IO_TEXTIOWRAPPER_ERRORS_GETSETDEF …
#endif
static PyObject *
_io_TextIOWrapper_errors_get_impl(textio *self);
static PyObject *
_io_TextIOWrapper_errors_get(textio *self, void *Py_UNUSED(context))
{ … }
#if !defined(_io_TextIOWrapper__CHUNK_SIZE_DOCSTR)
#define _io_TextIOWrapper__CHUNK_SIZE_DOCSTR …
#endif
#if defined(_IO_TEXTIOWRAPPER__CHUNK_SIZE_GETSETDEF)
# undef _IO_TEXTIOWRAPPER__CHUNK_SIZE_GETSETDEF
#define _IO_TEXTIOWRAPPER__CHUNK_SIZE_GETSETDEF …
#else
#define _IO_TEXTIOWRAPPER__CHUNK_SIZE_GETSETDEF …
#endif
static PyObject *
_io_TextIOWrapper__CHUNK_SIZE_get_impl(textio *self);
static PyObject *
_io_TextIOWrapper__CHUNK_SIZE_get(textio *self, void *Py_UNUSED(context))
{ … }
#if !defined(_io_TextIOWrapper__CHUNK_SIZE_DOCSTR)
#define _io_TextIOWrapper__CHUNK_SIZE_DOCSTR …
#endif
#if defined(_IO_TEXTIOWRAPPER__CHUNK_SIZE_GETSETDEF)
# undef _IO_TEXTIOWRAPPER__CHUNK_SIZE_GETSETDEF
#define _IO_TEXTIOWRAPPER__CHUNK_SIZE_GETSETDEF …
#else
#define _IO_TEXTIOWRAPPER__CHUNK_SIZE_GETSETDEF …
#endif
static int
_io_TextIOWrapper__CHUNK_SIZE_set_impl(textio *self, PyObject *value);
static int
_io_TextIOWrapper__CHUNK_SIZE_set(textio *self, PyObject *value, void *Py_UNUSED(context))
{ … }