fork download
  1. from inspect import isfunction
  2.  
  3. class Foo:
  4. var = 1
  5. def method_b(self, b): ...
  6. def method_a(self, a): ...
  7.  
  8. print([
  9. (name, obj.__code__.co_varnames)
  10. for name, obj in vars(Foo).items() if isfunction(obj)
  11. ])
Success #stdin #stdout 0.04s 10616KB
stdin
Standard input is empty
stdout
[('method_b', ('self', 'b')), ('method_a', ('self', 'a'))]