Class representing a byte quantity.
A byte quantity has both a quantity and a byte-related unit. Units
are maintained using the constants from util.py.
The quantity is maintained internally as a string so that issues of
precision can be avoided. It really isn't possible to store a floating
point number here while being able to losslessly translate back and forth
between XML and object representations. (Perhaps the Python 2.4 Decimal
class would have been an option, but I want to stay compatible with
Python 2.3.)
Even though the quantity is maintained as a string, the string must be
in a valid floating point positive number. Technically, any floating
point string format supported by Python is allowble. However, it does
not make sense to have a negative quantity of bytes in this context.
|
|
|
|
|
|
|
|
|
_setQuantity(self,
value)
Property target used to set the quantity The value must be a
non-empty string if it is not None . |
source code
|
|
|
_getQuantity(self)
Property target used to get the quantity. |
source code
|
|
|
|
|
_getUnits(self)
Property target used to get the units value. |
source code
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__
|