#14 content too accepting

PyXB 0.5.1
closed
None
fixed
Content model
major
PyXB 0.4.0
defect
2009-07-11
2009-06-29
No

The content model should prefer types that are close matches to the input; otherwise a double input can be stored in a byte data object simply because int(43.42) produces an integer.

Discussion

  • Peter A. Bigot

    Peter A. Bigot - 2009-06-29

    Changing element.compatibleValue to use something like:

    if issubclass(self.typeDefinition(), value_type):

    return self(value)

    instead of:

    return self(value)

    comes close.

     
  • Peter A. Bigot

    Peter A. Bigot - 2009-07-03
    • status changed from new to closed
    • resolution set to fixed
    • milestone set to PyXB 0.5.0

    Fixed in [1324].

     
  • Peter A. Bigot

    Peter A. Bigot - 2009-07-03
    • status changed from closed to reopened
    • resolution fixed deleted
    • milestone changed from PyXB 0.5.0 to PyXB 0.5.1

    The current implementation is better but not acceptable. Cf test-typeinf.

     
  • Peter A. Bigot

    Peter A. Bigot - 2009-07-11
    • status changed from reopened to closed
    • resolution set to fixed

    _TypeBinding_mixin:_CompatibleValue will not perform automatic type conversions except for int -> long, or string to something that accepts a string in its constructor. This means that content provided as constructor arguments must be exactly what the element wants: no more automatic promotion of ints to floats.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks