rope icon indicating copy to clipboard operation
rope copied to clipboard

moving of foo to bar.foo turns import foo to import bar.foo instead of from bar import foo

Open RonnyPfannschmidt opened this issue 7 years ago • 2 comments

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

RonnyPfannschmidt avatar Sep 12 '17 09:09 RonnyPfannschmidt

i should note that this is more of a unexpected unconvenience, as the code using the bits is changed correctly

RonnyPfannschmidt avatar Sep 12 '17 09:09 RonnyPfannschmidt

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.

soupytwist avatar Sep 12 '17 17:09 soupytwist