Skip to content

Commit 30bc18f

Browse files
committed
Better behaviour for JavaArray
1 parent e03d3df commit 30bc18f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

javaobj/deserialize/beans.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def constant(self):
382382
return self.value
383383

384384

385-
class JavaArray(ParsedJavaContent):
385+
class JavaArray(ParsedJavaContent, list):
386386
"""
387387
Represents a Java array
388388
"""
@@ -394,7 +394,8 @@ def __init__(
394394
field_type: FieldType,
395395
content: List[Any],
396396
):
397-
super().__init__(ContentType.ARRAY)
397+
list.__init__(self, content)
398+
ParsedJavaContent.__init__(self, ContentType.ARRAY)
398399
self.handle = handle
399400
self.classdesc = class_desc
400401
self.field_type = field_type
@@ -407,6 +408,13 @@ def __str__(self):
407408

408409
__repr__ = __str__
409410

411+
@property
412+
def _data(self):
413+
"""
414+
Mimics the javaobj API
415+
"""
416+
return tuple(self)
417+
410418

411419
class BlockData(ParsedJavaContent):
412420
"""

0 commit comments

Comments
 (0)