#91 Problem with fractionDigits violation

PyXB 1.2.4
Binding model
PyXB 1.1.2

As commented in the pyxb-users list, there was a problem validation decimal types[1].

I submit a patch to get decimal-type working with Python Decimal.

[1] http://sourceforge.net/mailarchive/forum.php?thread_name=57293.

1 Attachments


  • Peter A. Bigot

    Peter A. Bigot - 2011-05-22
    • status changed from new to accepted
    • milestone changed from PyXB 1.1.2 to PyXB 1.1.3

    While Python's decimal package provides exact values, which is good, it also incorporates a concept of significant digits that is not present in XML's xs:decimal, which may not be good. In particular, it's going to complicate the translation between lexical and value representations.

  • Peter A. Bigot

    Peter A. Bigot - 2011-09-09
    • milestone changed from PyXB 1.1.3 to PyXB 1.1.4
  • Peter A. Bigot

    Peter A. Bigot - 2012-06-13
    • milestone changed from PyXB 1.1.4 to PyXB 2.0.0

    I'm still concerned about how to reconcile the significant digits capabilities, so am pushing this off to the next major revision where incompatibilities are more likely to be allowed.

  • Peter A. Bigot

    Peter A. Bigot - 2014-02-05
    • status changed from accepted to closed
    • resolution set to fixed
    • milestone changed from PyXB 2.0.0 to PyXB 1.2.4

    The fix for this is now in the next branch of the git repository. Because Python's decimal.Decimal class is not fully interoperable with its float class, this may result in user-level breakage.

    commit 7504056ec5b4359f02182f40d2eea5b8f71dc31d
    Author: Peter A. Bigot <pab@pabigot.com>
    Date:   Wed Feb 5 12:44:53 2014 -0600
        trac/91: Problem with fractionDigits violation
        Change the value type for xs:decimal to be decimal.Decimal from its
        former type of types.FloatType.  This should make PyXB conformant with
        xs:decimal in terms of the totalDigits and fractionDigits constraining
        This is an interface change: some arithmetic operations between
        datatypes.decimal and Python floats are now likely to fail.

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

Sign up for the SourceForge newsletter:

No, thanks