Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrectly suggesting removal of module used in TYPE_CHECKING #313

Open
ntjess opened this issue Mar 23, 2024 · 1 comment
Open

Incorrectly suggesting removal of module used in TYPE_CHECKING #313

ntjess opened this issue Mar 23, 2024 · 1 comment
Assignees
Labels
bug Something isn't working changelog Changes should be written to the changelog file.

Comments

@ntjess
Copy link

ntjess commented Mar 23, 2024

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

@hakancelikdev hakancelikdev self-assigned this May 27, 2024
@hakancelikdev hakancelikdev added bug Something isn't working changelog Changes should be written to the changelog file. labels May 27, 2024
@hakancelikdev
Copy link
Owner

Thanks for letting me know, I'll work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working changelog Changes should be written to the changelog file.
Projects
Status: No status
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants