Refractor rename irrelevence files due to "(probable) usage"

I have a file that looks like this.

import os
train = 1

When I refactor the `train` to `file` using shift+F6 with scope being "Project Files". Everything named `train` in the project got changed to `file` even the code is, as you can see, import nothing from the project.

What I found is this

What the fuck?

Why is renaming a variable in a file that import nothing break 6 other files?

It's one thing to just find them, renaming everything that is just "probable" is so uncalled for.

Is there any way to disable this "Dynamic reference" in refactor by default other than manually delete them every time?

There's even a bug report here https://youtrack.jetbrains.com/issue/PY-46666 but all I can find is bear with it.

Please sign in to leave a comment.