FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-90102: Optimize io.FileIO.isatty() by serhiy-storchaka · Pull Request #112495 · python/cpython · GitHub

/ cpython Public

gh-90102: Optimize io.FileIO.isatty() - #112495

Closed
serhiy-storchaka wants to merge 2 commits into
python:mainfrom
serhiy-storchaka:cache-fileio-isatty
Closed

gh-90102: Optimize io.FileIO.isatty()#112495
serhiy-storchaka wants to merge 2 commits into
python:mainfrom
serhiy-storchaka:cache-fileio-isatty

Conversation

serhiy-storchaka commented Nov 28, 2023
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

Only invoke the isatty() system call for character devices and cache the result.

Only invoke the isatty() system call for character devices and
cache the result.
Comment thread Modules/_io/fileio.c Outdated

Copy link
Copy Markdown
Member Author

It does not work, because the file descriptor can be reassigned from tty to non-tty and vice versa. The result of isatty() can not be cached.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL