Skip to content
New issue

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

sleep_forever should be typed NoReturn #3095

Closed
Redoubts opened this issue Sep 27, 2024 · 3 comments · Fixed by #3096
Closed

sleep_forever should be typed NoReturn #3095

Redoubts opened this issue Sep 27, 2024 · 3 comments · Fixed by #3096
Labels
good first issue typing Adding static types to trio's interface

Comments

@Redoubts
Copy link
Member

I think this would be more correct? the trio-typing stubs did this: https://github.com/python-trio/trio-typing/blob/c7d97072e630cced81cb8a7bb30c0707f1a5d235/trio-stubs/__init__.pyi#L198

@A5rocks
Copy link
Contributor

A5rocks commented Sep 27, 2024

Good catch! Feel free to make a PR.

@A5rocks A5rocks added good first issue typing Adding static types to trio's interface labels Sep 27, 2024
@TeamSpen210
Copy link
Contributor

This is definitely correct, but I did notice a slight issue. It seems PyCharm has a bug where context managers won't be taken into account for unreachability. So the common case of a cancel-scope around sleep_forever will give spurious unreachable warnings.

Not sure if that is sufficient to prevent changing this.

@CoolCat467
Copy link
Member

I personally don't think we should avoid changing this just because an IDE's builtin type checker has bugs. If the type checker was separate from the IDE that might be a different story, but I'm sure they can fix this eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue typing Adding static types to trio's interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants