Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Are tuples immutable?
#9
(Jan-06-2019, 04:39 PM)ichabod801 Wrote:
(Jan-06-2019, 04:24 PM)python_user_n Wrote: Where I disagree is in the case you transfer this object (a tuple) somewhere you can't just transfer the integer and reference.
What do you mean by transfer?
I think they think all copies are deep copies?

@python_user_n - that's not the case. Given a tuple containing a list, copying the tuple does not require making a copy of the list. This can be verified empirically by creating the tuple containing the list, copying the tuple, modifying the list via one of the tuples, then observing through the other tuple that that list changed as well.
Reply


Messages In This Thread
Are tuples immutable? - by python_user_n - Jan-06-2019, 01:00 PM
RE: Are tuples immutable? - by perfringo - Jan-06-2019, 01:53 PM
RE: Are tuples immutable? - by buran - Jan-06-2019, 02:27 PM
RE: Are tuples immutable? - by python_user_n - Jan-06-2019, 02:41 PM
RE: Are tuples immutable? - by buran - Jan-06-2019, 03:06 PM
RE: Are tuples immutable? - by ichabod801 - Jan-06-2019, 03:28 PM
RE: Are tuples immutable? - by python_user_n - Jan-06-2019, 04:24 PM
RE: Are tuples immutable? - by ichabod801 - Jan-06-2019, 04:39 PM
RE: Are tuples immutable? - by micseydel - Jan-06-2019, 04:46 PM
RE: Are tuples immutable? - by python_user_n - Jan-06-2019, 05:21 PM
RE: Are tuples immutable? - by perfringo - Jan-07-2019, 08:04 AM
RE: Are tuples immutable? - by python_user_n - Jan-07-2019, 08:08 AM
RE: Are tuples immutable? - by buran - Jan-07-2019, 11:12 AM
RE: Are tuples immutable? - by python_user_n - Jan-07-2019, 01:26 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  immutable types Skaperen 2 2,112 Jul-09-2021, 01:00 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020