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

Type hints #206

Open
The-Compiler opened this issue Nov 26, 2018 · 2 comments · May be fixed by #379
Open

Type hints #206

The-Compiler opened this issue Nov 26, 2018 · 2 comments · May be fixed by #379

Comments

@The-Compiler
Copy link
Contributor

I recently started using mypy with my project and it says "No library stub file for module 'colorama'".

Do you have any plans to introduce type annotations for colorama? Those could be done in the code as comments, as a separate stub file, or (whenever Python 2 support is dropped), with a proper annotation syntax.

Also, thanks a lot for colorama - it made my life so much easier (especially on Windows) in various projects! 👍

@wiggin15
Copy link
Collaborator

There are currently no plans to add type hints.
I was not familiar with the mypy stub files. I'm open to pull requests with this option.

@exhuma
Copy link

exhuma commented Jan 31, 2019

Currently, the best way of doing this is by adding comments (if Python 2 compatibility is required) or annotations (if Python2 support can be ignored), and adding a py.typed file to the repo (See PEP-561).

Conforming to PEP-561 will make it work out-of-the box with mypy without the need to submitting files to typeshed. AFAIK, typeshed is no longer recommended to use anyway for this very reason.

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.

3 participants