You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
What about things like mypy -m foo.bar if foo is a namespace package? Users may expect it to work, since the module name is explicit. Similarly, what about mypy -p foo if foo is a namespace package?
The reason will be displayed to describe this comment to others. Learn more.
Hm, none of those currently work. Maybe they should, but I don't have time to make it work in this release (command line files/modules/packages use an entirely different code path than imported modules). I'll open a new issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -304,6 +304,10 @@ Note: this section describes only global-only import discovery options. See abov
a list of import discovery options that may be used
:ref:`both per-module and globally <config-file-import-discovery-per-module>`.
``namespace_packages`` (bool, default False)
Enables PEP 420 style namespace packages. See :ref:`the
corresponding flag <import-discovery>` for more information.
``python_executable`` (string)
Specifies the path to the Python executable to inspect to collect
a list of available :ref:`PEP 561 packages <installed-packages>`. Defaults to
Expand Down
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Maybe it would be worth talking about what to do in order to explicitly check code in namespace 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.
What about things like
mypy -m foo.bar
iffoo
is a namespace package? Users may expect it to work, since the module name is explicit. Similarly, what aboutmypy -p foo
iffoo
is a namespace package?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.
Hm, none of those currently work. Maybe they should, but I don't have time to make it work in this release (command line files/modules/packages use an entirely different code path than imported modules). I'll open a new issue.
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.
mypy -c 'import foo.bar'
, I suppose?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.
Hm, there are still problems with that. I'm not sure why. Will try to look into this before the release goes out.
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.
Maybe #5758?