Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

arrayCopy not working #9

Closed
jarav opened this Issue · 3 comments

2 participants

@jarav

a = [1,2,3]
b = [4,5,6]
arrayCopy(a,b)

java.lang.IllegalArgumentException: Argument is not an array

@jdf
Owner

a and b aren't arrays--they're Python lists. If you want to copy a list, you could either

a = [1,2,3,4,5]
b = a[:]

or

a = [1,2,3,4,5]
b = list(a)

or even

import copy
a = [1,2,3,4,5]
b = copy.copy(a)
@jarav

Since Python lists are the equivalent of arrays in Java or Processing, I was expecting arrayCopy to work on Python lists.

@jdf
Owner

Hmmm. Python lists are not really similar to Java arrays. They're more comparable to ArrayLists. Anyway, this is one of those places where processing.py will be pythonic.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.