fork(4) download
  1. import sys
  2. print(sys.version)
  3.  
  4. class Foo:
  5. """ A class """
  6. def bar():
  7. " Hello world "
  8. pass
  9.  
  10.  
  11. print(Foo.__doc__)
  12. print(Foo().__doc__)
  13. print(Foo.bar.__doc__)
  14. print(Foo().bar.__doc__)
  15.  
  16. from functools import wraps
  17. def my_decorator(f):
  18. @wraps(f)
  19. def wrapper(*args, **kwds):
  20. print('Calling decorated function')
  21. return f(*args, **kwds)
  22. return wrapper
  23.  
  24. @my_decorator
  25. def example():
  26. """Docstring"""
  27. print('Called example function')
  28. print(example.__doc__)
  29.  
Success #stdin #stdout 0.03s 10368KB
stdin
Standard input is empty
stdout
3.4.3+ (default, Jun  2 2015, 14:09:35) 
[GCC 4.9.2]
None
None
None
None
None