Skip to content

Incorrectly suggesting removal of module used in TYPE_CHECKING #313

@ntjess

Description

@ntjess
from qtpy import QtCore
import typing as t

if t.TYPE_CHECKING:
    from PySide6 import QtCore


class MyThread(QtCore.QThread):
    pass

In this example, unimport suggests getting rid of the first QtCore import, but this causes the code to fail.

Tested on unimport 1.2.1

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingchangelogChanges should be written to the changelog file.

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions