Guest User

Untitled

a guest
Jan 16th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. import string, pythis, pythat
  2. ...
  3. ...
  4. ...
  5. ...
  6. def func():
  7. blah
  8. blah
  9. blah
  10. from pysomething import foo
  11. foo()
  12. etc
  13. etc
  14. etc
  15. ...
  16. ...
  17. ...
  18.  
  19. >>> def f():
  20. from time import time
  21. print time()
  22.  
  23. >>> dis.dis(f)
  24. 2 0 LOAD_CONST 1 (-1)
  25. 3 LOAD_CONST 2 (('time',))
  26. 6 IMPORT_NAME 0 (time)
  27. 9 IMPORT_FROM 0 (time)
  28. 12 STORE_FAST 0 (time)
  29. 15 POP_TOP
  30.  
  31. 3 16 LOAD_FAST 0 (time)
  32. 19 CALL_FUNCTION 0
  33. 22 PRINT_ITEM
  34. 23 PRINT_NEWLINE
  35. 24 LOAD_CONST 0 (None)
  36. 27 RETURN_VALUE
  37.  
  38. >>> def g():
  39. print time()
  40.  
  41. >>> dis.dis(g)
  42. 2 0 LOAD_GLOBAL 0 (time)
  43. 3 CALL_FUNCTION 0
  44. 6 PRINT_ITEM
  45. 7 PRINT_NEWLINE
  46. 8 LOAD_CONST 0 (None)
  47. 11 RETURN_VALUE
  48.  
  49. def detect(self):
  50. import foobar
  51.  
  52. from prerequisite import foo
Add Comment
Please, Sign In to add comment