Replying to Avatar Matthew Martin

nostr:npub1xenx2ze286489qzhmddvr3t2aqac07ku653mtfx2dpj35zhvkl5qdej5uq extend and copy are surprising & the cheat sheet doesn't show the non-surprising version.

nostr:npub1xenx2ze286489qzhmddvr3t2aqac07ku653mtfx2dpj35zhvkl5qdej5uq copy is wrong too

>>> x = [1,2,3]

>>> x.extend([1,2,3])

>>> x

[1, 2, 3, 1, 2, 3]

>>> x.copy()

[1, 2, 3, 1, 2, 3]

>>> y = x.copy()

>>> y

[1, 2, 3, 1, 2, 3]

Reply to this note

Please Login to reply.

Discussion

No replies yet.