fork download
  1. class Foo:
  2. attr = 'bar'
  3.  
  4. def spam(self):
  5. pass
  6.  
  7. def __init__(self):
  8. self.a = 'eggs'
  9.  
  10. print(Foo.__dict__)
  11. print(list(filter(lambda f: not f.startswith('__') and not callable(getattr(Foo, f)), Foo.__dict__)))
  12.  
Success #stdin #stdout 0.01s 7736KB
stdin
Standard input is empty
stdout
{'__module__': '__main__', '__doc__': None, 'attr': 'bar', '__init__': <function __init__ at 0xb75f0d4c>, 'spam': <function spam at 0xb75f0d84>}
['attr']