Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> def test(a=[]):
- ... a.append('A')
- ... return a
- ...
- >>> import copy
- >>> z1= copy.copy(test.func_defaults)
- >>> z2= copy.deepcopy(test.func_defaults)
- >>> z1 == z2
- True
- >>> test()
- ['A']
- >>> z1 == z2
- False
- >>> z1
- (['A'],)
- >>> z2
- ([],)
Add Comment
Please, Sign In to add comment