-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Case insensitive when importing modules on Mac #1961
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
Comments
This doesn't look like it's related to the case insensitive filesystem -- mypy is careful not to be confused by that. I have tried to reconstruct the situation you described but I don't get an error from mypy. I had to change from .a import A to deal with the relative imports. If you still want to pursue this, please show the exact contents of your files. If not, please close the issue. (Also, I fixed up your post slightly -- hope I didn't destroy any information.) |
Sorry for my inaccuracy and carelessness about describing the file contents. In b/init.py, it is indeed
Also, there is a crucial thing I forgot to mention. In b/a, there is
so that Hope you can reconstruct the situation now. |
No, I still don't see it. Can you zip up the files you are using (the tree b/ and the file test.py) and attach them here? (Or upload somewhere and link from here, or create a gist with all of them? Also, what is the exact mypy invocation you are using, what mypy version are you using, and what platform? (Is it OS X? What version?) I have tested a variety of case-sensitivity issues and each time mypy does the right thing. |
I was using mypy 0.4.1, and mypy 0.4.3 worked perfectly on the constructed situation. By virtualenving different versions, I think this issue was solved in mypy 0.4.2. Thank you for the patience. |
It seems that mypy fails to deal with the case sensitive imports; it behaves abnormally when importing a object from a module if the object's name is case-incentively the same as the module's name.
Clarify this issue with a example. Suppose we have such a directory structure
in b/a, we define class
A
and in b/init.py we putfrom a import A
; in test.py we putfrom b import A
. In this situation,python test.py
normally emits no error whilemypy test.py
givesThis behavior seems to be due to the case insensitivity of mac's file system.
The text was updated successfully, but these errors were encountered: