Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A mutable string??
#3
That may be an efficiency with += for strings. Since you are adding on to the end of the string, and not creating a new variable name, Python may just add on to the underlying sequence in memory without moving anything around. Mutability/immutability is less of a memory thing than how multiple references to things are handled.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
A mutable string?? - by silentknight85 - May-30-2019, 03:56 PM
RE: A mutable string?? - by Larz60+ - May-30-2019, 06:18 PM
RE: A mutable string?? - by ichabod801 - May-30-2019, 06:22 PM
RE: A mutable string?? - by snippsat - May-30-2019, 10:21 PM
RE: A mutable string?? - by perfringo - May-31-2019, 05:33 AM
RE: A mutable string?? - by silentknight85 - May-31-2019, 10:11 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  using mutable in function defintion as optional paramter akbarza 8 574 Apr-27-2024, 09:59 PM
Last Post: snippsat
  mutable argument in function definition akbarza 1 535 Dec-15-2023, 02:00 PM
Last Post: deanhystad
  mutable values to string items? fozz 15 3,030 Aug-30-2022, 07:20 PM
Last Post: deanhystad
  "'DataFrame' objects are mutable, thus they cannot be hashed" Mark17 1 6,924 Dec-25-2020, 02:31 AM
Last Post: tinh
  Mutable Strings millpond 3 2,646 Aug-24-2020, 08:42 AM
Last Post: millpond
  What is the meaning of mutable data type? qliu 3 3,040 Apr-17-2020, 07:20 PM
Last Post: deanhystad
  copying parts of mutable sequences Skaperen 1 2,282 Dec-02-2019, 10:34 AM
Last Post: Gribouillis
  compacting a mutable sequence Skaperen 6 4,515 Jan-23-2018, 03:54 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