in my code, I have:
class A:
def a():
......
def b():
a()
......
b()
Then the compiler will say "NameError: global name a() is not defined." If I pull all the stuffs out of the class A, it would be no problem, but how can I define the method in class A? Thank you very much.
self.method_name
. Without the explicitself
how could you distinguish between a global function and a method(note: functions can be created at runtime -> it's impossible). – Frogman