Skip to content

UP029 triggers if import redefines previous import #16182

@injust

Description

@injust

Description

from math import *  # noqa: F403
from builtins import pow

pow(1, 1, 1)

https://play.ruff.rs/1f69e684-9b27-4626-ac06-4358cb6f9679

from math import pow
from builtins import pow

pow(1, 1, 1)

https://play.ruff.rs/d86b74ac-4412-4ca6-a8ec-902a31dce30f

from builtins import pow should not trigger UP029, since the import is not a no-op in either case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions