fork download
  1. import inspect
  2.  
  3. class A:
  4. pass
  5.  
  6. class B(A):
  7. pass
  8.  
  9. print(inspect.getsource(super(B)))
Runtime error #stdin #stdout #stderr 0.05s 10904KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 9, in <module>
  File "/usr/lib/python3.4/inspect.py", line 836, in getsource
    lines, lnum = getsourcelines(object)
  File "/usr/lib/python3.4/inspect.py", line 825, in getsourcelines
    lines, lnum = findsource(object)
  File "/usr/lib/python3.4/inspect.py", line 655, in findsource
    file = getsourcefile(object)
  File "/usr/lib/python3.4/inspect.py", line 571, in getsourcefile
    filename = getfile(object)
  File "/usr/lib/python3.4/inspect.py", line 536, in getfile
    'function, traceback, frame, or code object'.format(object))
TypeError: <super: <class 'B'>, NULL> is not a module, class, method, function, traceback, frame, or code object