rope
rope copied to clipboard
moving of foo to bar.foo turns import foo to import bar.foo instead of from bar import foo
while doing a move ofa toplevel package, i noticed, that we got the impport moved
so
import foo # staring point
import bar.foo # result
from bar import foo #expected
i should note that this is more of a unexpected unconvenience, as the code using the bits is changed correctly
Hmm, I think this is WAI, but giving more control over your preference of whether to use normal imports of from imports may be worthwhile. In this case, I think the imported name is rewritten and it remains a normal import-- that is unsurprising to me.
If, however, the original import were from waz import foo
and it got rewritten to import waz.bar.foo
, that seems more obviously incorrect.