I am trying to figure out the solution for the following problem:
#ExampleA.py
class a:
def my_great_method_A(self):
pass
#ExampleB.py
def functionX(inst_a): #Argument 'inst_a' will be always ExampleA.py's class a.
inst_a.my_great_method_A() #<---
I use Liclipse as a python editor. When I am typing the last line, "a.my_gr...", I want to have the editor's auto filling feature kicks in to suggest to use "my_great_method_A()". However, it actually does not suggest anything.
I understand why, because the editor doesn't have any clue if 'inst_a' is class 'a'. To deal with this issue, I could do the following to make the autofiller work:
#ExampleA.py
class a:
def my_great_method_A(self):
pass
#ExampleB.py
import ExampleA
def functionX(inst_a): #Argument 'inst_a' will be always ExampleA.py's class a.
ExampleA.a.my_great_method_A(inst_a) #<--- then autofilling works
However, for the code's readability, I would rather use the . format and I believe everyone the same way. But I do not know how everyone deals with this. Many times I have to go into the imported file and copy & paste the method name, which is tedious. Obviously I am missing something that everyone is aware of. By the way this is my first time to post on stackoverflow. I hope this is a valid thing to pose here.
athen why don't you makefunctionXa method?a?class adoesn't even have to be defined in the same file, or defined before you type in the body of the function. You can write words in a comment to that effect, but editors today are sadly lacking in the ability to parse and understand the true meaning of such things.