Skip to content

Sync typeshed #13977

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

Closed
wants to merge 3 commits into from
Closed

Sync typeshed #13977

wants to merge 3 commits into from

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Nov 1, 2022

Sync typeshed

Source commit:
python/typeshed@8036bbd

Note that you will need to close and re-open the PR in order to trigger CI.

mypybot and others added 3 commits November 1, 2022 00:06
This is allegedly causing large performance problems, see 13821

typeshed/8231 had zero hits on mypy_primer, so it's not the worst thing
to undo. Patching this in typeshed also feels weird, since there's a
more general soundness issue. If a typevar has a bound or constraint, we
might not want to solve it to a Literal.

If we can confirm the performance regression or fix the unsoundness
within mypy, I might pursue upstreaming this in typeshed.

(Reminder: add this to the sync_typeshed script once merged)
@hauntsaninja hauntsaninja reopened this Nov 1, 2022
@github-actions
Copy link
Contributor Author

github-actions bot commented Nov 1, 2022

Diff from mypy_primer, showing the effect of this PR on open source code:

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/builders/gettext.py:191:7: error: Cannot instantiate abstract class "LocalTimeZone" with abstract attribute "tzname"  [abstract]

bandersnatch (https://github.com/pypa/bandersnatch)
+ src/bandersnatch_storage_plugins/swift.py: note: In member "write_bytes" of class "SwiftPath":
+ src/bandersnatch_storage_plugins/swift.py:408: error: Signature of "write_bytes" incompatible with supertype "Path"  [override]
+ src/bandersnatch_storage_plugins/swift.py:408: note:      Superclass:
+ src/bandersnatch_storage_plugins/swift.py:408: note:          def write_bytes(self, data: Union[bytes, Union[bytearray, memoryview, array[Any], mmap, _CData, PickleBuffer]]) -> int
+ src/bandersnatch_storage_plugins/swift.py:408: note:      Subclass:
+ src/bandersnatch_storage_plugins/swift.py:408: note:          def write_bytes(self, contents: bytes, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> int

@hauntsaninja
Copy link
Collaborator

Yikes, looks like tuple is broken. My bet is the change to remove Sized. Speculating wildly, it's something to do with the ABCMeta class (maybe it has some recursive relationship with tuple)

@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Nov 1, 2022

Looks like^ is basically correct, fixing in python/typeshed#9058. typeshed tests didn't catch it because it only shows up after #13579

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.

1 participant