We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug pyright hangs and uses 100% CPU on particular python code.
To Reproduce Running pyright <file.py> on the code below hangs and pegs a CPU at 100%.
pyright <file.py>
Expected behavior It doesn't do that.
Screenshots or Code This is the most reduced test case I could produce:
from typing import Iterable, TypeVar, Union T = TypeVar("T") Tree = list[Union["Tree[T]", T]] def _flatten(tree: Union[Tree[T], T]) -> Iterable[T]: if not isinstance(tree, list): yield tree return for v in tree: yield from _flatten(v) def flatten(tree: Tree[T]) -> Iterable[T]: return _flatten(tree)
VS Code extension or command-line Command line, latest version from pip (1.1.289), Linux.
Additional context Originally found using pyright as LSP from neovim.
The text was updated successfully, but these errors were encountered:
Thanks for the bug report. This will be fixed in the next release.
Sorry, something went wrong.
The latest version from git still hangs if I modify the test case to call the function:
from typing import Iterable, TypeVar, Union T = TypeVar("T") Tree = list[Union["Tree[T]", T]] def _flatten(tree: Union[Tree[T], T]) -> Iterable[T]: if not isinstance(tree, list): yield tree return for v in tree: yield from _flatten(v) def flatten(tree: Tree[T]) -> Iterable[T]: return _flatten(tree) flatten([1,[2,3]])
Fixed a bug that led to infinite recursion in certain circumstances w…
831b9f0
…hen using a recursive type alias with a type variable. This addresses #4475.
This is included in pyright 1.1.290, which I just published. It will also be included in a future release of pylance.
No branches or pull requests
Describe the bug
pyright hangs and uses 100% CPU on particular python code.
To Reproduce
Running
pyright <file.py>
on the code below hangs and pegs a CPU at 100%.Expected behavior
It doesn't do that.
Screenshots or Code
This is the most reduced test case I could produce:
VS Code extension or command-line
Command line, latest version from pip (1.1.289), Linux.
Additional context
Originally found using pyright as LSP from neovim.
The text was updated successfully, but these errors were encountered: