-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Update ModuleType
to have __path__
optionally
#6200
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
Conversation
This comment has been minimized.
This comment has been minimized.
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, this should be a list. Also, under what circumstances is this ever None
?
Actually looking closer, sometimes this can be at least a _NamespacePath
(which is a MutableSequence).
Yeah arguable. In the other PR they were discussing about this because it may not exist at all which cannot be expressed. Or can it?
Oh ok. Like option to |
This comment has been minimized.
This comment has been minimized.
Thanks for reviewing! 🙏 |
We don't have a way to express "
|
`ModuleType.__path__` to be `MutableSequences[str]` covering `list` and `_NamespacePath` Co-authored-by: Akuli <akuviljanen17@gmail.com>
This comment has been minimized.
This comment has been minimized.
1 similar comment
Diff from mypy_primer, showing the effect of this PR on open source code: core (https://github.com/home-assistant/core.git)
+ homeassistant/loader.py:298: error: unused "type: ignore" comment
edgedb (https://github.com/edgedb/edgedb.git)
+ edb/schema/std.py:41: error: unused "type: ignore" comment
+ edb/schema/std.py:42: error: unused "type: ignore" comment
+ edb/schema/std.py:43: error: unused "type: ignore" comment
+ edb/schema/std.py:44: error: unused "type: ignore" comment
|
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!
a pleasure 🙇♀️ |
Hello typeshed crew!
Analog to #6186 I'd like to add
__path__
toModuleType
.Custom packages always have this attribute and currently getting
__path__
from these viasys.modules
like for instance:results in typing complaints like
Since
__file__
is already implemented.__path__
would also be good. Thanks.ëRiC