Skip to content

New feature: isort should move module-level-dunders to the correct place #1980

Open
@clavedeluna

Description

I can see in a related issue #711 dunders were at least prevented from moving. However, according to PEP8, dunders should come after future imports but before the other import block.

This is correct according to PEP8

from __future__ import barry_as_FLUFL

__all__ = ["barry_as_FLUFL"]
__version__ = '0.1'
__author__ = 'someone'

import os
import sys

This is incorrect


from __future__ import barry_as_FLUFL

import os 
import sys

__all__ = ["barry_as_FLUFL"]
__version__ = '0.1'
__author__ = 'someone'

But currently isort does not move the dunders. I propose this is implemented to correctly align with PEP8.
Related pylint issue pylint-dev/pylint#5471

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions