Suppose I have two methods in my class, methodA and methodB. In methodA, I create an object, S, of class X and then I want to pass this object to methodB. THen, when I am writing methodB, I want the type of X to be known so that when I use it, typing in my IDE, I can just type “X.” and see a list of methods and instance variables for S. Is this impossible in python?
def methodA(self):
S = X()
self.methodB(S)
def methodB(self, S):
"S."....#here I want to see all the methods of variable S.
This isn’t really a question about Python. Rather, it’s a question about IDEs.
I haven’t seen an IDE that would be able to do what you’re asking. Also, given the dynamic nature of Python, it would be very hard to implement such code completion except for some special cases.