Skip to content

F401 false positive when using Jupyter line magic (%timeit imported_thing()) #10454

Open
@flying-sheep

Description

@flying-sheep

I searched for “timeit F401” and didn’t find anything relevant.

Reproducer:

import os

%timeit os.getcwd()

Will show a false positive of F401 (Unused import) for the import os line:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationlinterRelated to the linternotebookRelated to (Jupyter) notebooks

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions