#963 Completion treats square-bracketed expression as list

1.4.8
open
5
2009-09-02
2009-09-02
Tim Lesher
No

When running against any expression of the form "a[0].", code completion suggests items appropriate for a list.

It should treat this as a call to the object's __getitem__ method and expand appropriately.

Examples:

(1,2,3)[0]. # shows items from dir(list); should show dir(int)

class IntDict(dict):
def __getitem__(self, k):
return int(k)
it = IntDict()
it[0]. # shows items from dir(list); should show dir(int), inferred from __getitem__
it.__getitem__('a'). #works -- shows dir(int)

Discussion