Jan-19-2020, 04:45 PM
(This post was last modified: Jan-19-2020, 04:46 PM by Gribouillis.)
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)