-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct code
Description
This test case fails unexpectedly:
[case testDivPython2FutureImportNotLeaking]
# flags: --python-version 2.7
import m1
[file m1.py]
import m2
class A(object):
def __div__(self, other):
# type: (str) -> str
return 'a'
reveal_type(A() / 'b') # N: Revealed type is "builtins.str"
[file m2.py]
from __future__ import division
[builtins fixtures/bool.pyi]
If I comment out the from __future__ import, the test case passes. It looks like the __future__ import leaks from m2 to m1. This was introduced in #11276.
Since we are close to creating a release brach, and the fix may be non-trivial, I'm going to revert #11276 to avoid a regression. The PR can be merged again once the issue has been fixed.
cc @sobolevn
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct code