-
-
Notifications
You must be signed in to change notification settings - Fork 176
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
Support Python typing #395
Comments
@asokolsky Thanks for reporting this:
|
I run mypy on my code which is using icalendar
No mypy warnings
From https://mypy.readthedocs.io/en/stable/existing_code.html Start small – get a clean mypy build for some files, with few annotations
Hope this helps. |
Is this feasable for 4.x branches where the compatibility reaches back to 2.7 and 3.4? I remember that comments where used at that time to di type hinting which was changed in 3.5. |
Don't take my word for it, but I think it is:
|
I am happy to see a pull request that shows some examples of how to go about it. Since the code is tested, is there a way to harvest the hints from the tests? An idea is to have a mypy branch that is based on master and that tests the annotations and can be worked on until it is green. What do you think? |
AFAIK there are the following options:
|
I would (maybe falsely) assume that people using type hints also like to use later Python versions that have them built in. The
As such, inline typing in the files |
How can you produce this? Which commands are you running?
|
do you mean how to get started? first of all you should install mypy: |
also relevant for this issue is PEP 561 – Distributing and Packaging Type Information
I'm not familiar with distributing packages though, but if I understand correctly, you would have to create an empty file setup(
...
package_data = {
'icalendar': ['py.typed'],
},
...
) |
@djbrown @asokolsky @angatha thanks for the discussion! It is very clear to me now how to approach this and I am happy the see a pull request!
|
I get:
The text was updated successfully, but these errors were encountered: