ValueUInt16¶
- class dsviper.ValueUInt16(initial_value=None)¶
Bases:
ValueA value of type uint16. Seamless with a Python int.
It holds 0 to 65535; outside that the constructor raises rather than truncating, and the error names the type you asked for.
Or use Value.create(Type.UINT16 [, initial_value]).
- ONE = 1¶
- ZERO = 0¶
- static cast(value: Value | _OutputValues) ValueUInt16¶
Return value as an uint16, or raise if it is not one.
- copy() ValueUInt16¶
Return a deep copy.
- description(*, namespace: NameSpace | None = None) str¶
Return the value written out, then its type, as <value>:<type>.
namespace qualifies the type name; representation() gives the value alone.
- encoded() int¶
Return a Python int.
- hash() int¶
Return the hash value.
- representation() str¶
Return the value written out: the number, in decimal.
- static try_parse(string: str) ValueUInt16 | None¶
Return string parsed as an uint16, or None if it does not parse.
- type_code() str¶
Return the code naming this kind of value, such as “int32”, “struct” or “vector”.