PyCQA / flake8-import-order

Flake8 plugin that checks import order against various Python Style Guides
GNU Lesser General Public License v3.0
278 stars 72 forks source link

Code which mixes `import` and `from-import` doesn't pass #14

Closed alex closed 10 years ago

alex commented 10 years ago

The following code gives a flake8 error, and I don't think it should:

import nacl.c
from nacl import encoding

If it's correct that this is failing, it'd be great if it the error message was a bit more descriptive.

public commented 10 years ago

This is because nacl.c is a different module to nacl and the sort order is based on the absolute module names.

This example might make the intention a bit more obvious

import package
from package import some_more_stuff

import package.module
from package.module import other_bits
alex commented 10 years ago

I suppose that makes a certain amount of sense, really this just reinforces my hatered of import package.module style. Closing this issue.