typeshed
typeshed copied to clipboard
Collection of library stubs for Python, with static types
Fixes https://github.com/python/typeshed/issues/12064.
There are some issues when using `next` when providing an empty collection as a default, let's take this example: ```python from collections.abc import Iterable def foo(iter: Iterable[list[int]]) -> None: next((item...
This PR fixes the issues detailed in https://github.com/python/typeshed/issues/11913. One of the main strategies for accommodating the fact that an empty list inherently changes the result of the return-type, is having...
Hi Based on this discussion on pyright: https://github.com/microsoft/pyright/discussions/7989#discussioncomment-9548709 A `collections.deque` is a valid `typing.Sequence`. However, `typing.Sequence` allows being sliceable, while a `collections.deque` does not support slicing. This makes room to...
I think you could make a good argument that `TypedDict.items()` should return `dict_items[LiteralString, object]`, as all of the keys are known at code initialization time.
Release: https://pypi.org/pypi/protobuf/5.28.0 Homepage: https://developers.google.com/protocol-buffers/ Repository: https://github.com/protocolbuffers/protobuf Typeshed stubs: https://github.com/python/typeshed/tree/main/stubs/protobuf If stubtest fails for this PR: - Leave this PR open (as a reminder, and to prevent stubsabot from opening another...
Closes: #12529 This is not a complete solution, but I think this is an improvement for any non-weird case. `MIMEPart` is *only* used as a base class of `EmailMessage` in...
The previous typehints ommitted the return type (and used the wrong return type for `psutil.cpu_times_percent`) and did not capture the overload behavior of `percpu=True`.
Mark constants as Final in _locale.pyi
Release: https://pypi.org/pypi/pyfarmhash/0.4.0 Homepage: https://github.com/veelion/python-farmhash Repository: https://github.com/veelion/python-farmhash Typeshed stubs: https://github.com/python/typeshed/tree/main/stubs/pyfarmhash If stubtest fails for this PR: - Leave this PR open (as a reminder, and to prevent stubsabot from opening another...