Advertisement
treyhunner

unpack.py

Aug 18th, 2021
1,463
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. """
  2. $ python3 -m dis unpack.py
  3.  
  4. ...
  5.  
  6. 21          12 BUILD_LIST               0
  7.             14 LOAD_NAME                1 (numbers)
  8.             16 LIST_EXTEND              1
  9.             18 STORE_NAME               2 (copy1)
  10.  
  11. 23          20 LOAD_NAME                3 (list)
  12.             22 LOAD_NAME                1 (numbers)
  13.             24 CALL_FUNCTION            1
  14.             26 STORE_NAME               4 (copy2)
  15.             28 LOAD_CONST               2 (None)
  16.             30 RETURN_VALUE
  17.  
  18. """
  19. numbers = [2, 1, 3, 4, 7, 11, 18]
  20.  
  21. copy1 = [*numbers]
  22.  
  23. copy2 = list(numbers)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement