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

DOC: Better type hints #211

Open
adriangb opened this issue Mar 4, 2021 · 6 comments
Open

DOC: Better type hints #211

adriangb opened this issue Mar 4, 2021 · 6 comments

Comments

@adriangb
Copy link
Owner

adriangb commented Mar 4, 2021

#208 has some nice type hint work. If #208 does not get merged, we should still bring in these changes separately.

@adriangb
Copy link
Owner Author

adriangb commented Mar 5, 2021

One big question here is: is it time to bump the minimum Python version to 3.7? This would allow us:

@stsievert
Copy link
Collaborator

I don't think #208 will get merged; you've got a better implementation in #210, and I don't want to deal with merge conflicts.

What's the current Python version?

What's the current Python version? It looks like the only user-facing advantage is around ArrayLike documentation. Is that accurate?

@adriangb
Copy link
Owner Author

adriangb commented Mar 5, 2021

The current Python version is 3.6.

Yes, as far as I can tell the only user advantage is documentation.

@stsievert
Copy link
Collaborator

Could that benefit be obtained if the docs were built with Python >= 3.7?

@adriangb
Copy link
Owner Author

adriangb commented Mar 5, 2021

I don't think so, because there needs to be __future__ import statements. Although maybe those can be put in try/except blocks?

@adriangb
Copy link
Owner Author

adriangb commented Mar 6, 2021

I think another alternative would be to move forward with implementing these type hints in 3.6. I think this would be really helpful for IDE auto-complete, etc.

For docs, we'll manually hardcode the "type" in the docstrings, which in practice just means changing array-like -> ArrayLike to match the actual type hints. I don't see how this is really a regression over what we currently have.

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

No branches or pull requests

2 participants