]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-101819: Prepare to modernize the _io extension (#104178)
authorVictor Stinner <vstinner@python.org>
Fri, 5 May 2023 23:53:55 +0000 (01:53 +0200)
committerGitHub <noreply@github.com>
Fri, 5 May 2023 23:53:55 +0000 (01:53 +0200)
commitc84029179c3287f9c357ccac231fe78469c6f068
tree4b30494f97bc9d71bb6381753e96441cbefc9dce
parent8b7f37dd4c297138e9f4a256ff6750cf1402b421
gh-101819: Prepare to modernize the _io extension (#104178)

* Add references to static types to _PyIO_State:

  * PyBufferedIOBase_Type
  * PyBytesIOBuffer_Type
  * PyIncrementalNewlineDecoder_Type
  * PyRawIOBase_Type
  * PyTextIOBase_Type

* Add the defining class to methods:

  * _io.BytesIO.getbuffer()
  * _io.FileIO.close()

* Add get_io_state_by_cls() function.
* Add state parameter to _textiowrapper_decode()
* _io_TextIOWrapper___init__() now sets self->state before calling
  _textiowrapper_set_decoder().

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Modules/_io/_iomodule.c
Modules/_io/_iomodule.h
Modules/_io/bufferedio.c
Modules/_io/bytesio.c
Modules/_io/clinic/bytesio.c.h
Modules/_io/clinic/fileio.c.h
Modules/_io/fileio.c
Modules/_io/stringio.c
Modules/_io/textio.c