typeshed
typeshed copied to clipboard
Collection of library stubs for Python, with static types
Adds correct return types for DB connection and cursor methods that deal with `namedtuple` and `dict`-like cursors. Currently the types are either incomplete (e.g. the connections' `cursor` methods do not...
There's a problem with `tuple_factory` and `dict_factory` in `dataclasses.pyi` Why? Because the given callback type does not really match `tuple` / `dict` constructors. Example: ```python from dataclasses import dataclass, astuple,...
I am getting a bunch of errors from mypy with the `types-paramiko` package. Some are imports that are not in the stubs for paramiko like `paramiko.PublicBlob` which is an alias...
Closes #8504
Refs https://github.com/python/typeshed/pull/8520
Example: ```python from dataclasses import dataclass, asdict @dataclass class D: x: int asdict(D(1), dict_factory=dict) # Argument "dict_factory" to "asdict" has incompatible type "Type[Dict[Any, Any]]"; expected "Callable[[List[Tuple[str, Any]]], Dict[_KT, _VT]]" ```...
`sys.exit()` is defined as: https://github.com/python/typeshed/blob/c68bcc7e69249956f358da7f47028d8fd1f7443e/stdlib/sys.pyi#L224-L225 The argument ends up in the `.code` attribute of a `SystemExit` exception. ```python3 >>> import sys >>> try: sys.exit ... except SystemExit as e: print(repr(e.code))...
3.10.6 was released a few days ago, and this caused a few stubtest failures on #8507. Unfortunately, GitHub Actions only seems to be using 3.10.6 for the Ubuntu stubtest run;...
#8483 by @sobolevn deleted `decimal.Context.__delattr__` from the stub, on the grounds that it had the exact same signature as `builtins.object.__delattr__`. I think the rationale for this deletion was incorrect, as...