GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — bpo-41818: Add termios.tcgetwinsize(), termios.tcsetwinsize(). Update docs. by 8vasu · Pull Request #23686 · python/cpython Conversation
|
|
@ethanfurman @aeros @gpshead @asvetlov Update1: These functions perform Update2: Added Update3: Added Update4: minor change: unlike |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Signed-off-by: Soumendra Ganguly <[email protected]>
|
@zoulasc Sir, can you please take a look at the changes that I made to termios.c? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Signed-off-by: Soumendra Ganguly <[email protected]>
Signed-off-by: Soumendra Ganguly <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@zoulasc Thank you for your time. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…etwinsize(). Signed-off-by: Soumendra Ganguly <[email protected]>
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Still waiting for core review. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'd ordinarily also ask for unittest coverage... but this is termios which doesn't appear to have any and might be challenging to automate given its purpose is more for interactive things (?). if you have ideas on that front, feel free to add the beginnings of a Lib/test/test_termios.py - but none of us are going to block this PR on that happening. :)
some comments to address below. primarily: use two item tuples instead of lists.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
|
|
||
| PyObject *v; | ||
| if (!(v = PyList_New(2))) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
When returning a constant number of values, it is more typical to use a tuple than a list. PyTuple_New and equivalent item setting calls. also update the docstrings in the comment above and on the next function to mention "two item tuple" and use ().
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@gpshead Sir, thank you for the review. I should mention that I used PyList_New() instead of PyTuple_New() because I wanted this function to resemble the other low level function termios.tcgetattr(), which also returns a list. Do you confirm this change?
Added: I should have been more specific: termios.tcgetattr() also returns a list of fixed length, and that cannot (?) be changed (backward compatibility?). I was wondering if termios.tcgetwinsize() should also behave similarly.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I ended up making the changes!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@gpshead Unfortunately, I am very busy with my PhD math research currently, and I apologize in advance for not having the time to write unittests for Fortunately, I had some time to spare during last December, when I had already written unittests for the @ambv please take a look at https://bugs.python.org/issue41818 if you have time :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…t two-item tuples instead of lists.
|
I have made the requested changes; please review again. Thank you for your patience. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for making the requested changes! @gpshead: please review the changes made to this pull request. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…quence, with overflow checking.
There was an error while loading. Please reload this page.
| output, :const:`TCIOFF` to suspend input, or :const:`TCION` to restart input. | ||
|
|
||
|
|
||
| .. function:: tcgetwinsize(fd) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
one follow up PR as I forgot to fix it up here, these need versionadded tags. I'll take care of it.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@gpshead Thank you for making the improvements!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Awesome to see this landed 👏🏻👏🏻👏🏻 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.