Add -rr/--reverse-relative option (issue #417)
This new option changes the sort order of relative imports. The new default
sort order is from furthest to closest (most dots to least dots):
from ... import a
from ...foo import x
from .. import b
from ..bar import y
from . import c
from .baz import z
With the new -rr/--reverse-relative option, the order of the relative
import *levels* (inter-order) is reversed, but the ordering within each
relative import level (intra-order) remains the same (i.e. normal lexical
order).
from . import c
from .baz import z
from .. import b
from ..bar import y
from ... import a
from ...foo import x
Signed-off-by:
Peter Grayson <pete@jpgrayson.net>
Loading
Please register or sign in to comment