Project

Profile

Help

Bug #5342

closed

PyXdmMap and PyXdmArray should be iterable

Added by O'Neil Delpratt 4 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Category:
Python Build
Start date:
2022-02-21
Due date:
% Done:

100%

Estimated time:
Found in version:
11.2
Fixed in version:
11.3
Platforms:

Description

Reported by user here: https://saxonica.plan.io/boards/4/topics/8571

As mentioned in the forum post it should be possible to iterate over a sequence of PyXdmMap in a for loop. Currently the following snippet:

for item in xdm_value:
        print(isinstance(item, PyXdmItem))
        print(isinstance(item, PyXdmMap))
        print(item)

Give the error:

Traceback (most recent call last):
  File "C:\SomePath\arrays-and-maps\createSequenceOfMapsTest1.py", line 18, in <module>
    print(item)
TypeError: __str__ returned non-string (type NoneType)


Related issues

Related to SaxonC - Feature #4848: PyXdmValue should be iterableClosedO'Neil Delpratt2020-12-03

Actions
Actions #1

Updated by O'Neil Delpratt 4 months ago

Actions #2

Updated by O'Neil Delpratt 4 months ago

  • Status changed from New to Resolved

PyXdmMap is iterable on the keys. Also further fix in the item_at() method on the XmdValue to support PyXdmMap and PyXdmArray.

Actions #3

Updated by O'Neil Delpratt 4 months ago

  • % Done changed from 0 to 100

PyXdmArray is iterable on the values.

Actions #4

Updated by O'Neil Delpratt 3 months ago

  • Status changed from Resolved to Closed
  • Fixed in version set to 11.3

Bug fix applied in the SaxonC 11.3 maintenance release.

Please register to edit this issue

Also available in: Atom PDF