Message405962
The doc https://docs.python.org/3/library/copy.html says:
"This module does not copy types like module, method, stack trace, stack frame, file, socket, window, array, or any similar types."
But it does copy arrays just fine:
import copy, array
a = array.array('i', [1, 2])
b = copy.copy(a)
a[0] = 3
print(a)
print(b)
Output:
array('i', [3, 2])
array('i', [1, 2]) |
|
Date |
User |
Action |
Args |
2021-11-08 16:53:12 | Stefan Pochmann | set | recipients:
+ Stefan Pochmann, docs@python |
2021-11-08 16:53:12 | Stefan Pochmann | set | messageid: <1636390392.43.0.38708438512.issue45752@roundup.psfhosted.org> |
2021-11-08 16:53:12 | Stefan Pochmann | link | issue45752 messages |
2021-11-08 16:53:12 | Stefan Pochmann | create | |
|