Home | Trees | Indices | Help |
|
---|
|
object --+ | utils.graph.DetailNode --+ | any_type.AnyType --+ | simple_type.SimpleType --+ | object --+ | | | utils.graph.DetailNode --+ | | | any_type.AnyType --+ | | | BinaryType --+ | BinarySimpleType --+ | object --+ | | | editable.EditableBase --+ | | | editable.EditableSpinBox --+ | IntType
Basic implementation of a 32-bit signed integer type. Also serves as a base class for all other integer types.
>>> from tempfile import TemporaryFile >>> tmp = TemporaryFile() >>> i = IntType() >>> i.value = -1 >>> i.value -1 >>> i.value = 0x11223344 >>> i.write(tmp) >>> j = IntType() >>> if tmp.seek(0): pass # ignore result for py3k >>> j.read(tmp) >>> hex(j.value) '0x11223344' >>> i.value = 2**40 # doctest: +ELLIPSIS Traceback (most recent call last): ... ValueError: ... >>> i.value = 'hello world' Traceback (most recent call last): ... ValueError: cannot convert value 'hello world' to integer >>> if tmp.seek(0): pass # ignore result for py3k >>> if tmp.write('"3D'.encode("ascii")): pass # b'"3D' >>> if tmp.seek(0): pass # ignore result for py3k >>> i.read(tmp) >>> hex(i.value) '0x44332211'
|
|||
Inherited from |
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from Inherited from Inherited from |
|
|||
_min = -2147483648 Minimum value. |
|||
_max = 2147483647 Maximum value. |
|||
_struct =
Character used to represent type in struct. |
|||
_size = 4 Number of bytes. |
|||
Inherited from |
|
|||
value A property which wraps the actual data. |
|||
Inherited from |
|
|
|
|
|
|
|
|
|
valueA property which wraps the actual data. This property always calls set_value to assign the value, and ensures that the value is valid (type, range, ...). Unless you know what you are doing, always use the value property to change the data.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Mon Oct 10 19:03:56 2011 | http://epydoc.sourceforge.net |