GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tempfile.SpooledTemporaryFile: inherit from IOBase on 3.11 by JelleZijlstra · Pull Request #7802 · python/typeshed

Conversation

@JelleZijlstra

@JelleZijlstra JelleZijlstra commented May 7, 2022

Copy link
Copy Markdown
Member

python/cpython#29560

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
JelleZijlstra and others added 2 commits May 6, 2022 22:31
@JelleZijlstra
tempfile.SpooledTemporaryFile: inherit from IOBase on 3.11
52c19bf
python/cpython#29560
@pre-commit-ci
[pre-commit.ci] auto fixes from pre-commit.com hooks
3381dba
@github-actions

This comment has been minimized.

Sign in to view
hauntsaninja
hauntsaninja approved these changes May 7, 2022
View reviewed changes
AlexWaygood
AlexWaygood reviewed May 7, 2022
View reviewed changes

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
AlexWaygood
AlexWaygood reviewed May 7, 2022
View reviewed changes
Comment thread stdlib/tempfile.pyi Resolved

Uh oh!

There was an error while loading. Please reload this page.

@AlexWaygood
Add missing import
5d41486
AlexWaygood
AlexWaygood reviewed May 7, 2022
View reviewed changes

@AlexWaygood AlexWaygood left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread stdlib/tempfile.pyi Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread stdlib/tempfile.pyi Resolved

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

This comment has been minimized.

Sign in to view
@JelleZijlstra
Fix pre-3.11 lies
20bbbca
@github-actions

This comment has been minimized.

Sign in to view
JelleZijlstra added 2 commits May 7, 2022 18:49
@JelleZijlstra
goodbye LSP
2f480cd
@JelleZijlstra
less cryptic name
14ed18d
@github-actions

This comment has been minimized.

Sign in to view
1 similar comment
@github-actions

This comment has been minimized.

Sign in to view
@JelleZijlstra
another one
c8793ec
@github-actions

This comment has been minimized.

Sign in to view
AlexWaygood
AlexWaygood reviewed May 8, 2022
View reviewed changes

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

What about the new detach() method? https://github.com/python/cpython/pull/29560/files#diff-6553a99f3ae04c9fc9c2349ac27037bfe3b274d5ca54d5800d9c5b5f11e29d21R813

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@JelleZijlstra
add .detach()
091a826
@github-actions

This comment has been minimized.

Sign in to view
AlexWaygood
AlexWaygood reviewed May 9, 2022
View reviewed changes
Comment thread stdlib/tempfile.pyi Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread stdlib/tempfile.pyi Resolved

Uh oh!

There was an error while loading. Please reload this page.

@AlexWaygood
Merge branch 'master' into JelleZijlstra-patch-7
0dbb9ec
@github-actions

This comment has been minimized.

Sign in to view
@JelleZijlstra
stubtest
d4d73e5
srittau
srittau reviewed May 17, 2022
View reviewed changes
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.

@srittau srittau May 17, 2022

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@JelleZijlstra JelleZijlstra May 18, 2022

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Done

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions

This comment has been minimized.

Sign in to view
JelleZijlstra added 3 commits May 17, 2022 18:08
@JelleZijlstra
pos-only args
1106632
@JelleZijlstra
comments
4a27d2d
@JelleZijlstra
Merge branch 'master' into JelleZijlstra-patch-7
ce2f8c2
AlexWaygood
AlexWaygood approved these changes May 18, 2022
View reviewed changes
@github-actions

This comment has been minimized.

Sign in to view
1 similar comment
@github-actions

github-actions Bot commented May 18, 2022

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JelleZijlstra

JelleZijlstra commented May 18, 2022

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JelleZijlstra
JelleZijlstra merged commit 8f5a835 into master May 18, 2022
@JelleZijlstra
JelleZijlstra deleted the JelleZijlstra-patch-7 branch May 18, 2022 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@srittau srittau srittau left review comments
@Akuli Akuli Akuli left review comments
@hauntsaninja hauntsaninja hauntsaninja approved these changes
@AlexWaygood AlexWaygood AlexWaygood approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@JelleZijlstra @srittau @hauntsaninja @Akuli @AlexWaygood
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.