-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
TYP: alias IndexLabel without Optional #36401
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ivanovmg lgtm pending green
Travis CI failed at miniconda build. Can anyone restart? |
Since |
lgtm. @simonjayhawkins can you address @rhshadrach question. |
for typing, yes. just as Union[int, float] is equivalent to float and the Optional in function signatures could be implicit. We do this for clarity and consistency. However, the actual convention that we should eventually adopt maybe determined by the outcome of #28585 and #33025. If we go the route of showing the aliases in the docs ( scikit-learn/scikit-learn#16705 (comment) and numpy/numpydoc#196 related), having the Optional maybe preferable. |
thanks @ivanovmg |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Previously in
_typing.py
we had the aliasIndexLabel
, which containedOptional
.The present PR eliminates
Optional
from the alias, but adds it in the code where necessary.Related to the issue raised by @simonjayhawkins in #36046 (comment)