-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Multi-line -c flag doesn't work on Windows #2269
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
Strange, that's not the case for me:
|
@ddfisher Strange. I'm running mypy C:\Users\Evan\Documents\GitHub> mypy -c '
>> a = 5 # type: str'
>>
C:\Users\Evan\Documents\GitHub> mypy -c 'a = 5 # type: str'
<string>:1: error: Incompatible types in assignment (expression has type "int", variable has type "str") |
Hmm. Mine is on mypy Maybe try:
and
|
@evhub If you can put a print() statement in mypy to confirm the string argument it is receiving that might shed light on the matter. It is likely some odd interaction with the Windows shell. I wonder if there's a CRLF vs. LF issue? E.g.
|
@ddfisher The C:\Users\Evan\Documents\GitHub> mypy -c '#first line
>> a = 5 # type: str'
>>
['#first line'] |
Have a look at mypy.bat:
https://github.com/python/mypy/blob/master/scripts/mypy.bat
I suspect the bug is there. Thanks for including the output from that
print() statement!
|
@gvanrossum Did a little bit of research, and it looks like this is just an inherit issue with |
See also #1226. As a work around you can use multiple -c flags: |
@gvanrossum Great, thanks! It seems like calling |
I believe this is fixed, as we now use |
Uh oh!
There was an error while loading. Please reload this page.
Simplest reproduction seems to be
which does not produce any errors, despite the fact that
a
is clearly incorrectly typed. The similarmypy -c 'a = 5 # type: str'
however, does show an error, which seems to indicate that the first behavior is definitely a bug.
The text was updated successfully, but these errors were encountered: