Jan-22-2020, 04:00 PM
(Jan-19-2020, 04:45 PM)Gribouillis Wrote:JohnnyCoffee Wrote:What I need to find out if it is possible to know is whether a method of a particular class exists?Try this for example>>> class A: ... def foo(self): pass ... def bar(self): pass ... >>> help(A)
Output:class A(builtins.object) | Methods defined here: | | bar(self) | | foo(self) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined)
Okay, is there any way to access the class file and see if a certain method exists?