Menu

#175 using Python base types for positional element constructor arguments

PyXB 1.2.1
closed
None
fixed
Binding model
minor
PyXB 1.1.5
defect
2012-12-15
2012-11-06
No

When using positional arguments of base Python types to construct element content, this will succeed if the element has simple type. If the element has complex type with simple content, it will be rejected unless wrapped with pyxb.BIND(). This had been done to prevent undesired translation of 6 to '6', but is arguably inconsistent.

Discussion

  • Peter A. Bigot

    Peter A. Bigot - 2012-11-06

    Placing this before the fail case in _TypeBinding_mixin._CompatibleValue fixes the issue, if the resulting test failures are acceptable.

            # Does the class have simple content which we can convert?
            if cls._IsSimpleTypeContent():
                return cls.Factory(value)
    
     
  • Peter A. Bigot

    Peter A. Bigot - 2012-11-08
    • milestone changed from PyXB 1.2.0 to PyXB 1.2.1
     
  • Peter A. Bigot

    Peter A. Bigot - 2012-12-15
    • status changed from new to closed
    • resolution set to fixed

    commit bd84f5c66a53f485f4162cec868e5f8f0c8e2192
    Author: Peter A. Bigot <pab@‌>
    Date: Wed Dec 12 14:25:03 2012 -0600

    trac/175: accept Python base types for positional element ctor args

     
MongoDB Logo MongoDB