Skip to content

TextIOBuffer _WrappedBuffer attr isatty should be bool #12437

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

Closed
ashleysommer opened this issue Jul 26, 2024 · 2 comments · Fixed by #12438
Closed

TextIOBuffer _WrappedBuffer attr isatty should be bool #12437

ashleysommer opened this issue Jul 26, 2024 · 2 comments · Fixed by #12438
Labels
stubs: false positive Type checkers report false errors topic: io I/O related issues

Comments

@ashleysommer
Copy link
Contributor

ashleysommer commented Jul 26, 2024

There was a small bug in this PR earlier this year to create a protocol for TextIOBuffer _WrappedBuffer
#11420

See here:

def isatty(self) -> int: ...

isatty should return bool.

Notice isatty on IOBase is a bool:

def isatty(self) -> bool: ...

And literally every other occurrence of isatty in every other type stub is a bool too.

Looks like the mistake came from this comment because that comment incorrectly lists isatty as int too.

@AlexWaygood AlexWaygood added the topic: io I/O related issues label Jul 26, 2024
@srittau
Copy link
Collaborator

srittau commented Jul 26, 2024

Good catch! PR welcome.

@ashleysommer
Copy link
Contributor Author

@srittau Easy. PR here: #12438

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stubs: false positive Type checkers report false errors topic: io I/O related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants