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
{{ message }}
Repository navigation
bool |= bool complains about incompatible assignment type #1793
I couldn't find any definitive specification on this other than PEP 285
Here's the input program (which I expect to cause no linting errors)
x=Truex|=False
However it results in the following:
$ mypy test.py
test.py:2: error: Incompatible types in assignment (expression has type "int", variable has type "bool")
$ pip freeze -l
mypy==0.560
psutil==5.4.2
typed-ast==1.1.0
It seems that PEP 285 is implemented faithfully in the versions of python I was able to check:
Activity
JelleZijlstra commentedon Dec 19, 2017
This sounds reasonable (if slightly unfortunate). Presumably you'll need the same change in the Python 2 stubs.
asottile commentedon Dec 19, 2017
yep -- I had that patch for python2 as well (just showed the
git diff -- stdlib/3in the issue so it was less noisy). I'll submit a PR