#1980·isort

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

Author: clavedelunaCreated Oct 20, 2022Updated Aug 11, 2026

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 https://github.com/PyCQA/pylint/issues/5471