-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Semantic analyzer confuses a function with a module #7203
Comments
I confirm this. Also I was able to find a much simpler repro. Here is a test case:
|
cc @JukkaL |
Note there is a similar issue modulo function -> class, see #7172:
|
Hi, is there any known workaround for this issue? |
A possible workaround is to move the definition of the function to
Alternatively, maybe you can define the function in both Does this help? The underlying issue may be hard to fix. |
I ended up importing as
instead of
Note that my specific case was classes, not functions, but I guess it's the same issue. |
I am having a similiar , any progress on this ? |
The following code creates a package structure that demonstrates what I think is a bug in mypy's new semantic analyzer.
When checking the created
src
package with mypy 0.720 and Python 3.7, I get the following error:What mypy thinks is a module is actually a function. It just has the same name as its containing module.
When I check with
--no-new-semantic-analyzer
, I do not get this error.The text was updated successfully, but these errors were encountered: