typeshed
typeshed copied to clipboard
Collection of library stubs for Python, with static types
When adding an argument with `argparse.ArgumentParser.add_argument`, it is tempting to pass `type=bool` to create an option that is specified without a value, such as `--enable-foo`. This doesn't work, and in...
Change #6685 switched to using `tuple[Any, ...]` instead of `Tuple[Any, ...]` (and `list` instead of `List`) in the `types-mock` package. This feature is only available in python3.9+ (see: https://mypy.readthedocs.io/en/stable/builtin_types.html#generic-types), leading...
**Bug Report** When using a class inheriting from io.IOBase, the signature for `__exit__` is detected incorrectly and prevents annotation of correct code. **To Reproduce** ``` class Foo(io.IOBase): def __exit__(self) ->...
The following prints `18446744073709551620` (as I discovered in https://github.com/python/cpython/issues/93077): ```python3 import io stream = io.TextIOWrapper(io.BytesIO(b'"")\r\nx\r\n')) stream.read(1) stream.read(1) stream.read(1) print('-----> tell:', stream.tell()) ``` This is not a bug. The documentation says...
I would be interested in contributing and working on typestubs for [tensorflow](https://www.tensorflow.org/api_docs/python/tf). It does have a fairly massive api though and am unsure whether it would be reasonable to have...
Right now types declared in [`numbers.pyi`](https://github.com/python/typeshed/blob/master/stdlib/numbers.pyi) are not used. This causes this problem: ```python from numbers import Real def test(f: Real) -> Real: return f test(1.32) # error: Argument 1...
I'm working to get rid of the type checker-specific symbols that currently are in our core stubs but don't exist at runtime. I'll use this issue to track the work...
I was writing up [an Issue on the Pylance project](https://github.com/microsoft/pylance-release/issues/2142) as I found a built-ins-example of my seen behavior in question which is the xml package with its stub here:...
While using mypy wit typeshed I noticed that some xml.minidom functions return values are annotated as `...`. I am no guru with the typing system, but I think here it...
Context: https://github.com/python/typeshed/pull/7065 Sometimes python / stubs do re-export constans from other modules. In this case we can: 1. Use re-export as well (correct option) 2. Duplicate these constants (ok-ish, but...