fork(2) download
  1. def some_func():
  2. return 'just a test'
  3.  
  4. def test(var):
  5. try:
  6. return var.__name__
  7. except AttributeError:
  8. # not something named (function, class, module)
  9. return None
  10.  
  11. print('%r' % test(some_func))
  12. some_func2 = some_func
  13. print('%r' % test(some_func2))
  14.  
Success #stdin #stdout 0.09s 10840KB
stdin
Standard input is empty
stdout
'some_func'
'some_func'