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

builtins: rename _LT #4579

Merged
merged 1 commit into from Sep 26, 2020
Merged

builtins: rename _LT #4579

merged 1 commit into from Sep 26, 2020

Conversation

hauntsaninja
Copy link
Collaborator

Having an obscure type variable name is causing some pretty inscrutable
errors. For instance:

xarray/core/utils.py:466: error: Value of type variable "_LT" of "sorted" cannot be "K"
tornado/simple_httpclient.py:324: error: Value of type variable "_LT" of "min" cannot be "Optional[float]"

I think having a more descriptive type variable name here is better for
user experience and helps address the "why" of an error. "_LT" is much
clearer in the context of the stub than it is out of context in an error.

Having an obscure type variable name is causing some pretty inscrutable
errors. For instance:
```
xarray/core/utils.py:466: error: Value of type variable "_LT" of "sorted" cannot be "K"
tornado/simple_httpclient.py:324: error: Value of type variable "_LT" of "min" cannot be "Optional[float]"
```

I think having a more descriptive type variable name here is better for
user experience and helps address the "why" of an error.
This was referenced Sep 26, 2020
@JelleZijlstra
Copy link
Member

I agree, I'm generally not too happy with the PEP 8 recommendation to give typevars very short names.

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 this pull request may close these issues.

None yet

2 participants