pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

Rename fails to rename generic function's usages in other files/cells

Open debonte opened this issue 1 year ago • 1 comments

Maybe I'm missing something, but with v2024.10.1 it doesn't work for me :( What am I missing here?

Image

Originally posted by @drorata in #3061

debonte avatar Oct 14 '24 14:10 debonte

This also repros in non-notebook scenarios where the generic function is imported. Usages in the declaring cell/file are renamed properly.

# test.py
from collections.abc import Sequence

def element[T: (int, str)](items: Sequence[T]) -> T:
    return items[0]
# test2.py
from test import element

e_int = element(items=[1, 2, 3])
print(e_int)

debonte avatar Oct 14 '24 14:10 debonte