-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add py.typed #4424
base: master
Are you sure you want to change the base?
Add py.typed #4424
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.
Nice
@@ -0,0 +1 @@ | |||
partial |
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.
py.typed
is just a marker file, per https://peps.python.org/pep-0561/#packaging-type-information
This marker applies recursively
It should be blank (e.g. just a file without any contents), so can you remove the text "partial"?
Are you interpreting the text partial
to be like a signifier of partial typing? I don't think anyone actually consumes the content of this file, for example mypy
just goes based on the file existing: https://github.com/python/mypy/blob/v1.14.1/mypy/modulefinder.py#L344-L345
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.
Regardless of what mypy consumes, this is literally what the standard specifies should be done: https://peps.python.org/pep-0561/#partial-stub-packages
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.
Oh I follow what you mean, thanks for sharing. TIL that partial
means to first check a stub package, then fall back on the runtime package.
Though I still don't think partial
should be here, as this is not a stub package, this is the actual runtime package. Does that make sense?
In other words, if this was an external stub package filled with .pyi
, then you'd put partial
. But that's not the case here, it's the runtime package with .py
files, so py.typed
should be blank
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.
I see. Fixed.
This is neither a doc pr nor a code pr, but a packaging PR! Related to #1103, this makes the existing partially-complete type annotations usable for checking projects which import plotly.