-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add importlib.metadata (Python >= 3.8) #3346
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
@rchen152 I have another pytype failure that I am unclear about: https://travis-ci.org/python/typeshed/jobs/596595124. "TypeError: Unexpected definition type <class 'NoneType'>", although all uses of
|
I'll take a look. To run pytype locally, the command is |
Huh. pytype can't parse nested classes inside a version check.
parses fine.
crashes the parser. I'll work on a fix. |
For python/typeshed#3346. PiperOrigin-RevId: 274858854
For python/typeshed#3346. PiperOrigin-RevId: 274858854
For python/typeshed#3346. PiperOrigin-RevId: 274858854
This passes CI now |
class DistributionFinder(MetaPathFinder): | ||
class Context: | ||
name: Optional[str] | ||
def __init__(self, *, name: Optional[str] = ..., path: List[str] = ..., **kwargs: Any) -> None: ... |
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.
Does it really need to be a list? The implementation doesn't seem to impose strong requirements, so Sequence
would be better. This also applies to line 40 above.
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.
path
is returned literally from Context.path
, so we'd need to change that return value as well to match. I believe this is mostly meant for internal use in MetadataPathFinder.find_distributions()
, which would accept an iterable as well, so we probably could change this without affecting users. It's a tradeoff, I can change it to whatever you prefer.
Part of #3319