You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this example the code functions as expected, and prints <class 'str'>, but the inferred type for f is IO[bytes] and the inferred type for content is consequently bytes, which is incorrect. The signature of zipfile.Path.open seems to assume a binary mode no matter what the mode argument actually is.
Python version: 3.10.11
PS: I am aware of #9966. I believe that that is a separate issue, because the issue there is about zipfile.Path.open arguments, whereas this issue is about the return value.
The text was updated successfully, but these errors were encountered:
* Add `CompleteDirs` and `FastLookup` (Python 3.8+).
* Add `Path.root` (Python 3.8+).
* Use concrete signature for `Path.open()` (Python 3.8).
* Fix signature of `Path.open()` for Python 3.9+:
+ Add overloads for text and binary modes with fixed return types.
+ Disallow extra arguments for binary modes.
+ Replace `*args` and `**kwargs` with accepted arguments for
text modes.
Closes: python#10847
* Add `CompleteDirs` and `FastLookup` (Python 3.8+).
* Add `Path.root` (Python 3.8+).
* Use concrete signature for `Path.open()` (Python 3.8).
* Fix signature of `Path.open()` for Python 3.9+:
+ Add overloads for text and binary modes with fixed return types.
+ Disallow extra arguments for binary modes.
+ Replace `*args` and `**kwargs` with accepted arguments for
text modes.
Closes: #10847
Example:
In this example the code functions as expected, and prints
<class 'str'>
, but the inferred type forf
isIO[bytes]
and the inferred type for content is consequentlybytes
, which is incorrect. The signature ofzipfile.Path.open
seems to assume a binary mode no matter what themode
argument actually is.Python version: 3.10.11
PS: I am aware of #9966. I believe that that is a separate issue, because the issue there is about
zipfile.Path.open
arguments, whereas this issue is about the return value.The text was updated successfully, but these errors were encountered: