Skip to content

remove redundant methods from _io classes #12761

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 2 commits into from
Oct 10, 2024
Merged

Conversation

tungol
Copy link
Contributor

@tungol tungol commented Oct 9, 2024

Following up on #12755

The __enter__'s were due to using TypeVar instead of Self originally. I'm not totally sure about the others, but they don't seem necessary anymore.

stdlib/_io.pyi Outdated
# Equals the "buffer" argument passed in to the constructor.
def detach(self) -> _BufferT_co: ... # type: ignore[override]
# TextIOWrapper's version of seek only supports a limited subset of
# operations.
def seek(self, cookie: int, whence: int = 0, /) -> int: ...

# The C implementation is not a subclass of TextIOWrapper at runtime,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The C implementation is the one that virtually all users would use, right? In that case, it would be better to follow the C implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't mind untangling that, but I think that's for another MR. I can remove the note if you'd prefer, it's not terribly important to capture that here right now.

This comment has been minimized.

Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@JelleZijlstra JelleZijlstra merged commit 42ebc89 into python:main Oct 10, 2024
63 checks passed
@tungol tungol deleted the io-clean branch October 23, 2024 17:06
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.

2 participants