Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isolate the _io extension module #101819

Open
erlend-aasland opened this issue Feb 11, 2023 · 1 comment
Open

Isolate the _io extension module #101819

erlend-aasland opened this issue Feb 11, 2023 · 1 comment
Assignees
Labels
3.12 expert-subinterpreters extension-modules C modules in the Modules dir type-feature A feature request or enhancement

Comments

@erlend-aasland
Copy link
Contributor

Isolate the _io extension module by moving all global variables to module state, porting static types to heap types, and implementing multi-phase init. All global variables in the _io module are static types:

  • Modules/_io/bufferedio.c: PyBufferedIOBase_Type
  • Modules/_io/bufferedio.c: PyBufferedRWPair_Type
  • Modules/_io/bufferedio.c: PyBufferedRandom_Type
  • Modules/_io/bufferedio.c: PyBufferedReader_Type
  • Modules/_io/bufferedio.c: PyBufferedWriter_Type
  • Modules/_io/bytesio.c: PyBytesIO_Type
  • Modules/_io/bytesio.c: _PyBytesIOBuffer_Type
  • Modules/_io/fileio.c: PyFileIO_Type
  • Modules/_io/iobase.c: PyIOBase_Type
  • Modules/_io/iobase.c: PyRawIOBase_Type
  • Modules/_io/textio.c: PyIncrementalNewlineDecoder_Type
  • Modules/_io/textio.c: PyTextIOBase_Type
  • Modules/_io/textio.c: PyTextIOWrapper_Type
  • Modules/_io/winconsoleio.c: PyWindowsConsoleIO_Type

Converting the static types to heap types involves applying PEP-687 to _io.
Adapting multi-phase init involves applying PEP-489 to _io.

@erlend-aasland erlend-aasland added type-feature A feature request or enhancement extension-modules C modules in the Modules dir expert-subinterpreters labels Feb 11, 2023
@erlend-aasland
Copy link
Contributor Author

cc. @kumaraditya303

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 expert-subinterpreters extension-modules C modules in the Modules dir type-feature A feature request or enhancement
Projects
Status: No status
Development

No branches or pull requests

2 participants