API: BinField class.¶
-
class
binfield.
BinField
(x=0, base=10, _parent=None)[source]¶ BinField representation.
Parameters: - x (typing.Union[int, str, bytes]) – Start value
- base (int) – base for start value
- _parent (typing.Optional[typing.Tuple[BinField, int]]) – Parent link. For internal usage only.
Note
Subclasses have getters for mapping indexes.
Note
Subclasses instances have getters and setters for mapping records.
-
_bit_size_
¶ int
- Number of bits necessary to represent in binary.
-
_value_
¶ int
- Internal value.
-
__iadd__
(other)[source]¶ int mimic.
Raises: - OverflowError – Result not fills in data length
- ValueError – negative result
-
__add__
(other)[source]¶ int mimic.
Return type: typing.Union[int, BinField] Raises: ValueError – negative result
-
__getstate__
()[source]¶ Pickling.
Return type: typing.Dict[str: int] Raises: ValueError – Pickle of linked instance
-
__getnewargs__
()¶ required for pickle.
Return type: typing.Tuple