Package pyxb :: Package binding :: Module datatypes :: Class decimal
[hide private]
[frames] | no frames]

Class decimal

source code

                    object --+                
                             |                
                       cscRoot --+            
                                 |            
     utils.utility.Locatable_mixin --+        
                                     |        
              basis._TypeBinding_mixin --+    
                                         |    
                            object --+   |    
                                     |   |    
utils.utility._DeconflictSymbols_mixin --+    
                                         |    
                        object --+       |    
                                 |       |    
                           cscRoot --+   |    
                                     |   |    
            basis._DynamicCreate_mixin --+    
                                         |    
                basis.simpleTypeDefinition --+
                                             |
                                object --+   |
                                         |   |
                           decimal.Decimal --+
                                             |
                            object --+       |
                                     |       |
                               cscRoot --+   |
                                         |   |
        basis._RepresentAsXsdLiteral_mixin --+
                                             |
                                            decimal

XMLSchema datatype decimal.

This class uses Python's decimal.Decimal class to support (by default) 28 significant digits. Only normal and zero values are valid; this means NaN and Infinity may be created during calculations, but cannot be expressed in XML documents.

Nested Classes [hide private]
  _XsdBaseType
XMLSchema datatype anySimpleType.
Instance Methods [hide private]

Inherited from basis.simpleTypeDefinition: __init__, pythonLiteral, xsdConstraintsOK, xsdLiteral, xsdValueLength

Inherited from basis._TypeBinding_mixin: __setattr__, toDOM, toxml, validateBinding

Inherited from decimal.Decimal: __abs__, __add__, __complex__, __copy__, __deepcopy__, __div__, __divmod__, __eq__, __float__, __floordiv__, __format__, __ge__, __gt__, __hash__, __int__, __le__, __long__, __lt__, __mod__, __mul__, __ne__, __neg__, __nonzero__, __pos__, __pow__, __radd__, __rdiv__, __rdivmod__, __reduce__, __repr__, __rfloordiv__, __rmod__, __rmul__, __rpow__, __rsub__, __rtruediv__, __str__, __sub__, __truediv__, __trunc__, adjusted, as_tuple, canonical, compare, compare_signal, compare_total, compare_total_mag, conjugate, copy_abs, copy_negate, copy_sign, exp, fma, is_canonical, is_finite, is_infinite, is_nan, is_normal, is_qnan, is_signed, is_snan, is_subnormal, is_zero, ln, log10, logb, logical_and, logical_invert, logical_or, logical_xor, max, max_mag, min, min_mag, next_minus, next_plus, next_toward, normalize, number_class, quantize, radix, remainder_near, rotate, same_quantum, scaleb, shift, sqrt, to_eng_string, to_integral, to_integral_exact, to_integral_value

Inherited from decimal.Decimal (private): _check_nans, _cmp, _compare_check_nans, _divide, _fill_logical, _fix, _fix_nan, _iseven, _isinfinity, _isinteger, _islogical, _isnan, _ln_exp_bound, _log10_exp_bound, _power_exact, _power_modulo, _rescale, _round, _round_05up, _round_ceiling, _round_down, _round_floor, _round_half_down, _round_half_even, _round_half_up, _round_up

Inherited from object: __delattr__, __getattribute__, __reduce_ex__, __sizeof__, __subclasshook__

Class Methods [hide private]
 
_CheckValidValue(cls, value)
NB: Invoking this on a value that is a list will, if necessary, replace the members of the list with new values that are of the correct item type.
source code
 
XsdLiteral(cls, value)
Convert from a python value to a string usable in an XML document.
source code

Inherited from basis.simpleTypeDefinition: PythonLiteral, SimpleTypeDefinition, XsdConstraintsOK, XsdSuperType, XsdValueLength

Inherited from basis._TypeBinding_mixin: Factory

Inherited from decimal.Decimal: from_float

Static Methods [hide private]
a new object with type S, a subtype of T
__new__(cls, *args, **kw)
Create a decimal point instance.
source code
Class Variables [hide private]
  _ExpandedName = <pyxb.namespace.ExpandedName object>
The expanded name of the component.
  _CF_enumeration = <pyxb.binding.facets.CF_enumeration object>
  _CF_fractionDigits = <pyxb.binding.facets.CF_fractionDigits ob...
  _CF_maxExclusive = <pyxb.binding.facets.CF_maxExclusive object>
  _CF_maxInclusive = <pyxb.binding.facets.CF_maxInclusive object>
  _CF_minExclusive = <pyxb.binding.facets.CF_minExclusive object>
  _CF_minInclusive = <pyxb.binding.facets.CF_minInclusive object>
  _CF_pattern = <pyxb.binding.facets.CF_pattern object>
  _CF_totalDigits = <pyxb.binding.facets.CF_totalDigits object>
  _CF_whiteSpace = <pyxb.binding.facets.CF_whiteSpace object>
  __SimpleTypeDefinition = <pyxb.xmlschema.structures.SimpleType...
  _httpwww_w3_org2001XMLSchema_decimal_FacetMap = {<class 'pyxb....

Inherited from basis.simpleTypeDefinition (private): _ReservedSymbols

Inherited from basis._TypeBinding_mixin: _validationConfig_

Inherited from decimal.Decimal (private): _pick_rounding_function

Properties [hide private]

Inherited from basis._TypeBinding_mixin (private): _validationConfig

Inherited from decimal.Decimal: imag, real

Inherited from decimal.Decimal (private): _exp, _int, _is_special, _sign

Inherited from object: __class__

Method Details [hide private]

__new__(cls, *args, **kw)
Static Method

source code 

Create a decimal point instance.

>>> Decimal('3.14')              # string input
Decimal('3.14')
>>> Decimal((0, (3, 1, 4), -2))  # tuple (sign, digit_tuple, exponent)
Decimal('3.14')
>>> Decimal(314)                 # int or long
Decimal('314')
>>> Decimal(Decimal(314))        # another decimal instance
Decimal('314')
>>> Decimal('  3.14  \n')        # leading and trailing whitespace okay
Decimal('3.14')
Returns: a new object with type S, a subtype of T
Overrides: object.__new__
(inherited documentation)

_CheckValidValue(cls, value)
Class Method

source code 

NB: Invoking this on a value that is a list will, if necessary, replace the members of the list with new values that are of the correct item type. This is permitted because only with lists is it possible to bypass the normal content validation (by invoking append/extend on the list instance).

Overrides: basis.simpleTypeDefinition._CheckValidValue
(inherited documentation)

XsdLiteral(cls, value)
Class Method

source code 

Convert from a python value to a string usable in an XML document.

This should be implemented in the subclass.

Overrides: basis.simpleTypeDefinition.XsdLiteral
(inherited documentation)

Class Variable Details [hide private]

_CF_fractionDigits

Value:
<pyxb.binding.facets.CF_fractionDigits object>

__SimpleTypeDefinition

Value:
<pyxb.xmlschema.structures.SimpleTypeDefinition object>

_httpwww_w3_org2001XMLSchema_decimal_FacetMap

Value:
{<class 'pyxb.binding.facets.CF_pattern'>: <pyxb.binding.facets.CF_pat\
tern object>,
 <class 'pyxb.binding.facets.CF_enumeration'>: <pyxb.binding.facets.CF\
_enumeration object>,
 <class 'pyxb.binding.facets.CF_whiteSpace'>: <pyxb.binding.facets.CF_\
whiteSpace object>,
 <class 'pyxb.binding.facets.CF_minInclusive'>: <pyxb.binding.facets.C\
F_minInclusive object>,
...