inspect_fodder2.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # line 1
  2. def wrap(foo=None):
  3. def wrapper(func):
  4. return func
  5. return wrapper
  6. # line 7
  7. def replace(func):
  8. def insteadfunc():
  9. print 'hello'
  10. return insteadfunc
  11. # line 13
  12. @wrap()
  13. @wrap(wrap)
  14. def wrapped():
  15. pass
  16. # line 19
  17. @replace
  18. def gone():
  19. pass
  20. # line 24
  21. oll = lambda m: m
  22. # line 27
  23. tll = lambda g: g and \
  24. g and \
  25. g
  26. # line 32
  27. tlli = lambda d: d and \
  28. d
  29. # line 36
  30. def onelinefunc(): pass
  31. # line 39
  32. def manyargs(arg1, arg2,
  33. arg3, arg4): pass
  34. # line 43
  35. def twolinefunc(m): return m and \
  36. m
  37. # line 47
  38. a = [None,
  39. lambda x: x,
  40. None]
  41. # line 52
  42. def setfunc(func):
  43. globals()["anonymous"] = func
  44. setfunc(lambda x, y: x*y)
  45. # line 57
  46. def with_comment(): # hello
  47. world
  48. # line 61
  49. multiline_sig = [
  50. lambda (x,
  51. y): x+y,
  52. None,
  53. ]
  54. # line 68
  55. def func69():
  56. class cls70:
  57. def func71():
  58. pass
  59. return cls70
  60. extra74 = 74
  61. # line 76
  62. def func77(): pass
  63. (extra78, stuff78) = 'xy'
  64. extra79 = 'stop'
  65. # line 81
  66. class cls82:
  67. def func83(): pass
  68. (extra84, stuff84) = 'xy'
  69. extra85 = 'stop'
  70. # line 87
  71. def func88():
  72. # comment
  73. return 90
  74. # line 92
  75. def f():
  76. class X:
  77. def g():
  78. "doc"
  79. return 42
  80. return X
  81. method_in_dynamic_class = f().g.im_func