You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Actually, reading through that vscode-python bug, the user is expecting to see list functions on a, not just __getitem__ and __iter__. I'm not sure if that's exactly correct, though, since I don't think the generic type assumes anything other than "I can be indexed" and "I can be iterated over".
Reading through that thread also shows that def func(a: List) will show completions for a as though it were list, but def func(a: List[str]) will not, which seems to indicate that there's something else going on here.
I have updated my comment to drop the a[0] case as that case works as demonstrated, but as Jake Bailey (@jakebailey) realized the a case is not working as it should be showing all completions that list would show.
Activity
MikhailArkhipov commentedon Oct 15, 2018
jakebailey commentedon Oct 15, 2018
Yeah, this works for both of those two cases:
jakebailey commentedon Oct 15, 2018
Actually, reading through that vscode-python bug, the user is expecting to see list functions on a, not just
__getitem__and__iter__. I'm not sure if that's exactly correct, though, since I don't think the generic type assumes anything other than "I can be indexed" and "I can be iterated over".jakebailey commentedon Oct 15, 2018
Reading through that thread also shows that
def func(a: List)will show completions foraas though it werelist, butdef func(a: List[str])will not, which seems to indicate that there's something else going on here.jakebailey commentedon Oct 15, 2018
typing.pysays:Which to me implies that it should be inheriting everything from
list.[-]Work with generics[/-][+]Fix List[T] not inheriting list/List methods[/+]brettcannon commentedon Oct 15, 2018
I have updated my comment to drop the
a[0]case as that case works as demonstrated, but as Jake Bailey (@jakebailey) realized theacase is not working as it should be showing all completions thatlistwould show.