Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-108411: Make typing.IO/BinaryIO arguments positional-only#142906

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
SpecLad wants to merge1 commit intopython:main
base:main
Choose a base branch
Loading
fromSpecLad:io-positional-only

Conversation

@SpecLad
Copy link
Contributor

@SpecLadSpecLad commentedDec 17, 2025
edited by bedevere-appbot
Loading

IO is purported to be the type of the file objects returned byopen. However, all methods on those objects take positional-only arguments, whileIO's methods are declared with regular arguments. As such, the file objects cannot actually be considered to implementIO. The same thing applies toBinaryIO.

Fix this by adjusting the definition of these ABCs to match the file objects.

This is technically a breaking change, but it is unlikely to actually break anything:

  • These methods should never be called at runtime, since they are abstract. Therefore, this should not cause any runtime errors.

  • In typeshed these arguments are already positional-only, so this should not cause any errors during typechecking either.

`IO` is purported to be the type of the file objects returned by `open`.However, all methods on those objects take positional-only arguments, while`IO`'s methods are declared with regular arguments. As such, the file objectscannot actually be considered to implement `IO`. The same thing applies to`BinaryIO`.Fix this by adjusting the definition of these ABCs to match the file objects.This is technically a breaking change, but it is unlikely to actually breakanything:* These methods should never be called at runtime, since they are abstract.  Therefore, this should not cause any runtime errors.* In typeshed these arguments are already positional-only, so this should  not cause any errors during typechecking either.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@JelleZijlstraJelleZijlstraAwaiting requested review from JelleZijlstraJelleZijlstra is a code owner

@AlexWaygoodAlexWaygoodAwaiting requested review from AlexWaygoodAlexWaygood is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@SpecLad

[8]ページ先頭

©2009-2025 Movatter.jp