pyright
pyright copied to clipboard
Static Type Checker for Python
**Describe the bug** i have no idea what's going on here, i tried to minify it as best as i can. it seems that the type displayed in pyright's errors/notes...
**Describe the bug** I'm trying to write a generic container class `Container[T]`, and support method `do_map(self, func: Callable[[T], W]) -> Container[W]` that do a transform like `map()`. For some reasons,...
```python from collections.abc import Callable default_cache: dict[str, int] = {} def foo[T](x: T, y: dict[str, T] = default_cache) -> T: ... def takes_identity[T](func: Callable[[T], T], value: T) -> None: func(value)...
**Describe the bug** While type checking code below pyright hangs indefinitely. **Code or Screenshots** ```python from collections import abc from typing_extensions import TypeVar, TypeVarTuple, Unpack T = TypeVar("T") PosArgsT =...
**Describe the bug** See sample code below. In function `f`, `v1` can be assigned to `v0` and `v2` can be assigned to `v1`, but `v2` cannot be directly assigned to...
**Describe the bug** If a function is declared like `def func[T0, T1](arg0: T0, arg1: T1) -> T0 | T1: ...`, and gets called like `func(a, b)` when type of `a`...
**Describe the bug** I think I've managed to get myself down to [the last few type bugs in my library](https://github.com/Gobot1234/steam.py/actions/runs/6283510493/job/17064043045) and the last one that's confusing me is a TypeVar...
Steps to reproduce: install [rye](https://rye.astral.sh), then for instance: ```bash mkdir repro cd repro rye init rye add quart echo "import quart" > src/repro/foo.py rye install pyright pyright ``` This worked...
pyright 1.1.371 ```python from typing import TypeAlias from typing import reveal_type class A: pass class B: pass class C: pass AB: TypeAlias = A | B ABC: TypeAlias = AB...
pyright 1.1.371 ```python from typing import TypeVar, TypeVarTuple, reveal_type T = TypeVar("T") TT = TypeVarTuple("TT") def do(tup: tuple[T, *TT]) -> tuple[T, *TT]: match tup: case (first, *last_n): reveal_type(last_n) # Type...