typeshed
typeshed copied to clipboard
Collection of library stubs for Python, with static types
For instance, this script passes mypy: ```python import contextlib from typing import Iterator @contextlib.contextmanager def f() -> Iterator[int]: return iter([1]) with f(): pass with f(): raise TypeError('wat') ``` but fails...
I'm quite surprised because I can use a Counter to store non-integer values. Is it a feature or just permissiveness in implementation? E.g. the following code works (tested on python...
… to preserve signatures of wrapped and wrapper functions.
This issue is supposed to track when we can start to use parameter specification variables ([PEP 612](https://www.python.org/dev/peps/pep-0612/)) in typeshed. Support is needed in released versions of: * [ ] mypy...
Cf. python/typing#182 I have deliberately not added this to any existing stubs, since that might be disruptive and needs experimentation independent from the alias itself.
It seems `third_party/3/docutils` contains only very few classes and modules of docutils. https://github.com/python/typeshed/tree/master/third_party/3/docutils For example, the only one class `reference` is defined at `nodes.pyi`. But actual `docutils.nodes` module provides many...
This is not an easy problem, and I don't expect that we will fix this soon. But I'd like to at least start a discussion about ways to move the...
# Reproducer ``` python3.8 -m venv /tmp/py38 source /tmp/py38/bin/activate pip -q install mypy stubtest concurrent.futures ``` # Tentative fix ```diff diff --git a/stdlib/concurrent/futures/_base.pyi b/stdlib/concurrent/futures/_base.pyi index 5b756d87..fc6a342c 100644 --- a/stdlib/concurrent/futures/_base.pyi +++...
```py from enum import Enum value: Enum reveal_type(value) reveal_type(value.name) ``` ``` > mypy --python-version 3.10 test.py test.py:5: note: Revealed type is "enum.Enum" test.py:6: note: Revealed type is "str" Success: no...