-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix stub for SpooledTemporaryFile #2452
Conversation
At the moment, inheriting from |
stdlib/3/tempfile.pyi
Outdated
prefix: Optional[str] = ..., dir: Optional[str] = ... | ||
) -> None: ... | ||
def rollover(self) -> None: ... | ||
def __enter__(self) -> 'SpooledTemporaryFile': ... |
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.
Quoting is not necessary in stubs.
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.
Fixed.
I copied the abstract methods from |
Could you have a look at the build failures? It seems that imports of |
Fixed, thanks for the pointers. |
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.
Sorry for the long delay, this PR slipped through the cracks somehow.
Please remove the @abstractmethod
markers from all methods, since there are concrete implementations in SpooledTemporaryFile
. A few more notes below.
CI is failing, because |
Fixes #2431.
Not sure if inheriting from
IO[Any]
is the right way to do it, because in reality the class does not, but it implements the protocol. What is the proper way to indicate that?Also updates some argument types to include
Optional
explicitly, to match the definition.