Skip to content

gh-155496: Use Argument Clinic for more functions of the _io module - #155511

Draft
serhiy-storchaka wants to merge 6 commits into
python:mainfrom
serhiy-storchaka:io-clinic
Draft

gh-155496: Use Argument Clinic for more functions of the _io module#155511
serhiy-storchaka wants to merge 6 commits into
python:mainfrom
serhiy-storchaka:io-clinic

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

Convert the methods of BufferedRWPair, the readinto() and write() methods of _RawIOBase, __enter__(), __exit__() and the _check*() methods of _IOBase, the pickling support and __sizeof__() of BytesIO, and the private methods of FileIO.

BufferedRWPair now forwards the arguments to the reader or the writer without packing them into a tuple.

The __getstate__() methods are left as they are, because a single C function is shared by several types.

PyObject_CallMethodNoArgs() and PyObject_CallMethodOneArg() look up the
method and call it in one step, without creating a bound method object.
The pickling support and __sizeof__() of BytesIO no longer need separate
"lock held" functions.
The getters of _WindowsConsoleIO are left as they are, because Argument
Clinic fails for an accessor in a preprocessor conditional block.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant