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

tempfile.SpooledTemporaryFile: inherit from IOBase on 3.11 by JelleZijlstra · Pull Request #7802 · python/typeshed · GitHub

tempfile.SpooledTemporaryFile: inherit from IOBase on 3.11 - #7802

Merged
JelleZijlstra merged 13 commits into
masterfrom
JelleZijlstra-patch-7
May 18, 2022
Merged

tempfile.SpooledTemporaryFile: inherit from IOBase on 3.11#7802
JelleZijlstra merged 13 commits into
masterfrom
JelleZijlstra-patch-7

Conversation

Copy link
Copy Markdown
Member

This comment has been minimized.

AlexWaygood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'd prefer us to use a wordier-but-more-readable alias name, like _SpooledTemporaryFileBase, rather than _STFBase which feels a bit opaque.

Comment thread stdlib/tempfile.pyi Outdated

AlexWaygood left a comment
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It looks like in typeshed, we've always pretended that SpooledTemporaryFile has readable() and seekable() methods on Python <3.11 (see the comment on line 330), even though they don't at runtime. This is because SpooledTemporaryFile inherits from IO in typeshed, and IO has readable() and seekable() as abstract methods.

Comment thread stdlib/tempfile.pyi Outdated
Comment thread stdlib/tempfile.pyi Outdated

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

1 similar comment

This comment has been minimized.

This comment has been minimized.

AlexWaygood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This comment has been minimized.

Comment thread stdlib/tempfile.pyi Outdated
Comment thread stdlib/tempfile.pyi

This comment has been minimized.

Comment thread stdlib/tempfile.pyi Outdated
Comment on lines +221 to +222
# It does not actually derive from IO[AnyStr], but it does mostly behave
# like one.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The comment should probably be moved down above the class itself.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done

This comment has been minimized.

This comment has been minimized.

1 similar comment

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Member Author

hm, I expected unused stubtest allowlist entries. I'll look into that in a followup PR.

JelleZijlstra merged commit 8f5a835 into master May 18, 2022
JelleZijlstra deleted the JelleZijlstra-patch-7 branch May 18, 2022 01:41
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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL