Python ver of System.arraycopy() in Java

J

Jordan

I could seem to find a built in function that would serve the purpose
of System.arraycopy() in java.

I was able to accomplish it with something like this:

def arraycopy(source, sourcepos, dest, destpos, numelem):
dest[destpos:destpos+numelem] = source[sourcepos:sourcepos
+numelem]


is there a built in version, or better way of doing this...
 
M

Miki

Hello,
I could seem to find a built in function that would serve the purpose
of System.arraycopy() in java.

I was able to accomplish it with something like this:

def arraycopy(source, sourcepos, dest, destpos, numelem):
    dest[destpos:destpos+numelem] = source[sourcepos:sourcepos
+numelem]

is there a built in version, or better way of doing this...
This *is* the built in way :)

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top