Message9056
Much as we saw with #1631, java.util.List objects do not have all the list methods, so they do not duck type properly as Python list objects (or more properly collections.Sequence):
$ jython27
>>> from java.util import ArrayList
>>> x = ArrayList()
>>> x.append("foo")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'java.util.ArrayList' object has no attribute 'append'
Note that we actually make this guarantee, but don't fulfill it:
https://hg.python.org/jython/rev/9fef5da411e5
>>> from collections import Sequence
>>> isinstance(x, Sequence)
True
Fix for beta 4. Use list_tests support library (used by test_list) to verify ops. Also looks at comprehensive support for set. |
|
Date |
User |
Action |
Args |
2014-09-29 21:48:07 | zyasoft | set | recipients:
+ zyasoft, nonameentername |
2014-09-29 21:48:07 | zyasoft | set | messageid: <1412027287.16.0.81794830618.issue2215@psf.upfronthosting.co.za> |
2014-09-29 21:48:06 | zyasoft | link | issue2215 messages |
2014-09-29 21:48:06 | zyasoft | create | |
|