On Sat, 3 Apr 2010, Andi Vajda wrote:

Yes, you could, were it not for the bug that, currently, --sequence code does not heed parameterization. I'm fixing this next.

So, assuming this bug were fixed, using:

  --sequence java.util.AbstractList 'size:()I' 'get:(I)Ljava/lang/Object;'

Note: you can't use List since, in Python, ArrayList doesn't inherit from List because a Python C type can have only one base and that's AbstractList <- AbstractCollection <- Object. Hence, use AbstractList instead.

Then, in your code:

  >>> list = ArrayList().of_(Stuff)
  >>> list.add(Stuff())
  >>> list[0]
  <Stuff ...>

It's now fixed in trunk:

   >>> a = ArrayList().of_(String)
   >>> a.add('foo')
   >>> a.add('bar')
   >>> a[0]
   <String foo>
   >>> a[1]
   <String bar>

Andi..

Reply via email to