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

Add public API for type checkers #44

Closed
alkatar21 opened this issue Oct 6, 2022 · 1 comment · Fixed by #46
Closed

Add public API for type checkers #44

alkatar21 opened this issue Oct 6, 2022 · 1 comment · Fixed by #46

Comments

@alkatar21
Copy link
Contributor

The code works like this, but at least pylance can recognize that there is Timer, but does not recognize it as part of the public API:

grafik

Adding the following to the __init__.py would solve this.

# Use __all__ to let type checkers know what is part of the public API.
__all__ = ('Timer', 'TimerError')

I could make a PR for this. But then the question would arise whether __all__ should also be added in the modules and whether relative imports should be used in general?

@gahjelle
Copy link
Collaborator

gahjelle commented Oct 7, 2022

Thanks for the report. If you have the capacity, I'd be grateful for a PR.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants