is there any way to get iPython to recognize the type of "each" in B.printBarList(). for example I want to use tab-complete in iPython so I type "each." but it doesn't know the type.
# A.py class A: def __init__(self): self._foo = "FOO" def getFoo(self): return self._foo
# B.py from A import A class B: def createBarList(self): '''create 10 instances of A in barList''' barList = [] for i in range(10): barList.append(A()) return barList def printBarList(self, barList): ''' Itter over each A in barList and print each ***MY QUESTION*** the "each" in the loop below ''' for each in barList: print(each.foo) if __name__ == "__main__": b = b() barList = b.createBarList() b.printBarList()
Moderator Larz60+: Changed icode tags to Python tags (see help, BBCODE)