10000 gh-101819: Refactor _io futher in preparation for module isolation by erlend-aasland · Pull Request #104369 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-101819: Refactor _io futher in preparation for module isolation #104369

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

Merged
merged 11 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor: change function declaration
Pass defining class to:

- _WindowsConsoleIO.read
- _WindowsConsoleIO.readinto
- _WindowsConsoleIO.write
  • Loading branch information
erlend-aasland committed May 10, 2023
commit c07026fe3e7a0acca5a3f5c977feb5de920feaa1
96 changes: 75 additions & 21 deletions Modules/_io/clinic/winconsoleio.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 12 additions & 6 deletions Modules/_io/winconsoleio.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,15 +735,17 @@ readinto(winconsoleio *self, char *buf, Py_ssize_t len)

/*[clinic input]
_io._WindowsConsoleIO.readinto
cls: defining_class
buffer: Py_buffer(accept={rwbuffer})
/

Same as RawIOBase.readinto().
[clinic start generated code]*/

static PyObject *
_io__WindowsConsoleIO_readinto_impl(winconsoleio *self, Py_buffer *buffer)
/*[clinic end generated code: output=66d1bdfa3f20af39 input=4ed68da48a6baffe]*/
_io__WindowsConsoleIO_readinto_impl(winconsoleio *self, PyTypeObject *cls,
Py_buffer *buffer)
/*[clinic end generated code: output=96717c74f6204b79 input=4b0627c3b1645f78]*/
{
Py_ssize_t len = readinto(self, buffer->buf, buffer->len);
if (len < 0)
Expand Down Expand Up @@ -899,6 +901,7 @@ _io__WindowsConsoleIO_readall_impl(winconsoleio *self)

/*[clinic input]
_io._WindowsConsoleIO.read
cls: defining_class
size: Py_ssize_t(accept={int, NoneType}) = -1
/

Expand All @@ -910,8 +913,9 @@ Return an empty bytes object at EOF.
[clinic start generated code]*/

static PyObject *
_io__WindowsConsoleIO_read_impl(winconsoleio *self, Py_ssize_t size)
/*[clinic end generated code: output=57df68af9f4b22d0 input=8bc73bc15d0fa072]*/
_io__WindowsConsoleIO_read_impl(winconsoleio *self, PyTypeObject *cls,
Py_ssize_t size)
/*[clinic end generated code: output=7e569a586537c0ae input=a14570a5da273365]*/
{
PyObject *bytes;
Py_ssize_t bytes_size;
Expand Down Expand Up @@ -952,6 +956,7 @@ _io__WindowsConsoleIO_read_impl(winconsoleio *self, Py_ssize_t size)

/*[clinic input]
_io._WindowsConsoleIO.write
cls: defining_class
b: Py_buffer
/

Expand All @@ -962,8 +967,9 @@ The number of bytes actually written is returned.
[clinic start generated code]*/

static PyObject *
_io__WindowsConsoleIO_write_impl(winconsoleio *self, Py_buffer *b)
/*[clinic end generated code: output=775bdb16fbf9137b input=be35fb624f97c941]*/
_io__WindowsConsoleIO_write_impl(winconsoleio *self, PyTypeObject *cls,
Py_buffer *b)
/*[clinic end generated code: output=e8019f480243cb29 input=10ac37c19339dfbe]*/
{
BOOL res = TRUE;
wchar_t *wbuf;
Expand Down