You can create arrays of only one type using array , but it is not intended to store custom classes.
The python way is to simply create a list of objects:
a = [myCls() for _ in xrange(10)]
You might want to take a look at fooobar.com/questions/254169 / ....
Note:
Be careful with these notations, IT IS NECESSARY WHAT YOU INTEND TO:
a = [myCls()] * 10
This will also create a list with a tenfold increase in the myCls object, but it will be ten times larger than one separate object, and not ten independently created objects.
source share