Python Forum
copying parts of mutable sequences
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
copying parts of mutable sequences
#1
i would like to copy items from one sequence to another (to mutable), of like type, from and to specific positions until a point to stop such as a specific length. of course i can code a loop to do this. i wonder if there is a function or method for doing this. in C and Pike there are library calls for this. in many CPU architectures, such as IBM mainframes, there are machine instructions for this. i want to do such copying to mutable sequences (to list and bytearray, maybe from tuple and bytes). is there anything ready to use, that doesn't need to be installed, or will i create my own?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
Do you mean something like
another[5:10] = sequence[3:8]
?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  mutable argument in function definition akbarza 1 426 Dec-15-2023, 02:00 PM
Last Post: deanhystad
  detect equal sequences in list flash77 17 2,683 Oct-28-2022, 06:38 AM
Last Post: flash77
  mutable values to string items? fozz 15 2,700 Aug-30-2022, 07:20 PM
Last Post: deanhystad
  "'DataFrame' objects are mutable, thus they cannot be hashed" Mark17 1 6,723 Dec-25-2020, 02:31 AM
Last Post: tinh
  Mutable Strings millpond 3 2,500 Aug-24-2020, 08:42 AM
Last Post: millpond
  needleman wunsch algorithm for two sequences of different length johnny_sav1992 0 1,675 Jul-27-2020, 05:45 PM
Last Post: johnny_sav1992
  What is the meaning of mutable data type? qliu 3 2,876 Apr-17-2020, 07:20 PM
Last Post: deanhystad
  help for escape sequences NewPi 1 1,997 Dec-11-2019, 11:22 PM
Last Post: ichabod801
  Convert weekly sequences to date and time. SinPy 0 1,422 Nov-23-2019, 05:20 PM
Last Post: SinPy
  Copying a file Kundan 1 2,057 Aug-21-2019, 09:55 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

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