Closed
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