Python ver of System.arraycopy() in Java

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jordan

    Python ver of System.arraycopy() in Java

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

    I was able to accomplish it with something like this:

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


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

    #2
    Re: Python ver of System.arraycop y() in Java

    Hello,
    I could seem to find a built in function that would serve the purpose
    of System.arraycop y() in java.
    >
    I was able to accomplish it with something like this:
    >
    def arraycopy(sourc e, sourcepos, dest, destpos, numelem):
        dest[destpos:destpos +numelem] = source[sourcepos:sourc epos
    +numelem]
    >
    is there a built in version, or better way of doing this...
    This *is* the built in way :)

    HTH,
    --
    Miki <miki.tebeka@gm ail.com>
    If it won't be simple, it simply won't be. [Hire me, source code]



    Comment

    Working...