Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 578 Bytes

F401.md

File metadata and controls

24 lines (16 loc) · 578 Bytes
code message title
F401
Module imported but unused
Module imported but unused (F401)

A module has been imported but is not used anywhere in the file. The module should either be used or the import should be removed.

Anti-pattern

In this example, it is likely that namedtuple was going to be used instead of a regular tuple. However, namedtuple was never used. It should be removed.

from collections import namedtuple

my_tuple = ('Grant', 'McConnaughey', 25)

Best practice

my_tuple = ('Grant', 'McConnaughey', 25)