Skip to content
Commit e60c651a authored by Peter Grayson's avatar Peter Grayson
Browse files

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: default avatarPeter Grayson <pete@jpgrayson.net>
parent f0badf18
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment