.. _misplaced-future:

misplaced-future / W0410
========================

**Message emitted:**

__future__ import is not the first non docstring statement

**Description:**

*Python 2.5 and greater require __future__ import to be the first non docstring statement in the module.*

**Problematic code:**

.. literalinclude:: /data/messages/m/misplaced-future/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/m/misplaced-future/good.py
   :language: python

**Additional details:**

A bare raise statement will re-raise the last active exception in the current scope. If the ``raise`` statement is not in an ``except`` or ``finally`` block, a RuntimeError will be raised instead.


Created by the `imports <https://github.com/PyCQA/pylint/blob/main/pylint/checkers/imports.py>`__ checker.