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
[case testReexport]
import a
def f(x: int) -> int:
return a.g(x)
[file a.py]
from b import g
[file b.py]
def g(x: int) -> int:
return x + 1
we fail to compile during C compilation with the failure:
/tmp/mypy-test-_hn916r6/tmp/native.c: In function ‘CPyDef_f’:
/tmp/mypy-test-_hn916r6/tmp/native.c:78:16: error: ‘CPyStatic_b_module’ undeclared (first use in this function); did you mean ‘CPyStatic_a_module’?
The problem here is that the name of the def a.g is resolved to is b.g, and b isn't imported.
It is easy to hack around, though.
The text was updated successfully, but these errors were encountered:
There are a couple parts to this:
* Compile module attribute accesses by compiling the LHS on its own
instead of by loading its fullname (which will be what mypy thinks
its source is)
* Only use the static modules if they have actually been imported
Fixesmypyc/mypyc#393.
With the following test:
we fail to compile during C compilation with the failure:
The problem here is that the name of the def
a.g
is resolved to isb.g
, andb
isn't imported.It is easy to hack around, though.
The text was updated successfully, but these errors were encountered: