-
Notifications
You must be signed in to change notification settings - Fork 61
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
Feature Request: Typings #148
Comments
@ehossack I understand why you are asking for this, but I don't understand why. We have documentation with type annotations for more than a year now. Now that 2.7 and 3.4 are out, we can move the type annotations from docstrings to nicer syntax, but almost everything is documented. What would change for you if the typings were provided in Python 3.5-compatible manner? |
Hi sorry for the delay @ppolewicz What would change is tooling like mypy would be able to recognize and check the type annotations. Docstrings is usable when reading/browsing, but sometimes they are incorrect, and do not enable automated tooling to verify the validity of your calls to the SDK. Does that make sense? |
ok so your project uses mypy and you'd like to have warnings for improper calls to b2sdk? |
Yes. That's correct. |
All right, I now understand. The difficulty of work required to do this is not actually that high, the number of public interface classes is quite low (I'd say it's mostly B2Api, Bucket, sync and utils, maybe a couple of small classes like FileVersion). Would you like to try to implement this @ehossack? It would be a really nice contribution. We'd then install mypy to make sure the types are correctly set inside b2sdk. |
Hi, I can potentially take this on, but have a couple other queued contributions to make first (will be at least a couple of weeks, if not more), so if anyone else sees this and wants to take in on first, please do so! |
@ppolewicz one thing I've noticed is that if this projects adds type annotations, it will be incompatible with 3.5 and below. Given the next release notes indicate the next version will drop support for 2.7 and 3.4, and that 3.5 is no longer supported after this month, is that compatible with the release plans? If so, thinking about approaching this issue out loud:
|
I think we've dropped support for 2.7 and 3.4 already, please talk with @mlech-reef about adding the linter, I'm not sure which stage would be appropriate |
Hi.
Using typing and
If you want to start working on that, I will be more than happy to support you if you need. The mypy linter can be added to the |
This project has grown considerably since this was originally opened. A few of Python have been deprecated as well.
We are open to contributions adding type hints for old APIs. |
Request:
Provide typings for python
Sufficient to support libraries like
mypy
.A starting point perhaps: https://mypy.readthedocs.io/en/stable/stubgen.html?highlight=generate
Not sure if this has already been considered, but I saw no record of it.
It would also make using some of your APIs more intuitive, as I have a hard time discerning return types.
Thanks!
The text was updated successfully, but these errors were encountered: