Skip to content
This repository was archived by the owner on Dec 8, 2023. It is now read-only.
This repository was archived by the owner on Dec 8, 2023. It is now read-only.

ensure_imported does not add import if there is a from import from the same module #26

@vlopezferrando

Description

@vlopezferrando

When you have an import of the form:

from math import log

And then you want to ensure that math is imported with:

where {
    $import = "math",
    $import <: ensure_imported(),
}

You would expect that the resulting code is:

import math
from math import log

But the code is left as is, as the pattern does not match. Here is a studio reproducing the issue

Metadata

Metadata

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