Potential Python 3 Issue. #52

chaosape opened this Issue Mar 3, 2016 · 2 comments


None yet

2 participants

chaosape commented Mar 3, 2016

transitionSortKey in generate.py can return a tuple containing None if st is None. On line 340 in generate.py transitions are sorted using transitionSortKey; python 2 would engage in some voodoo to evaluate mistyped inequalities, python 3 does not allow this.

@pabigot pabigot added this to the PyXB 1.2.5 milestone Mar 3, 2016
pabigot commented Mar 3, 2016

Thanks for reporting this. I suspect that substituting zero in that case would handle it, but if the sort key is ever used to detect that a transition lacks a consuming state the sort operation will have to be given a comparison function that replicates the concept of a bottom value.

The (different) sort key for schema order has a comment noting that this feature of Python 3 had been taken into account.

pabigot commented Mar 3, 2016

To ensure uniqueness the substitution value should be -1.

@pabigot pabigot added a commit that closed this issue Mar 3, 2016
@pabigot fix #52: incomparable element in FAC sort key
The transition sort key is a tuple of keys identifying candidate
destinations.  For the tuple values to be comparable they must be
element-wise comparable; normal keys are non-negative integers, so
change the flag value for transitions without consuming states to be -1
which is comparable with other states under Python 3.
@pabigot pabigot closed this in a27390a Mar 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment