mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-15 11:04:55 +00:00
ubuiltins.int: Document from_bytes manually.
Sphinx fails to show the docsting for class methods. Since we have very few of them, it is easier to just document this one manually Fixes https://github.com/pybricks/pybricks-api/issues/86
This commit is contained in:
@@ -36,7 +36,26 @@ Basic types
|
||||
|
||||
.. pybricks-requirements::
|
||||
|
||||
..
|
||||
_comment: The int class is defined manually because otherwise the classmethod is hidden, see https://github.com/pybricks/pybricks-api/issues/86
|
||||
|
||||
.. autoclass:: ubuiltins.int
|
||||
:no-members:
|
||||
|
||||
.. automethod:: ubuiltins.int.to_bytes
|
||||
|
||||
.. classmethod:: from_bytes(bytes: Union[bytes, bytearray], byteorder: Literal["little", "big"]) -> int
|
||||
|
||||
Returns the integer represented by the given bytes.
|
||||
|
||||
:param bytes: The bytes to convert.
|
||||
:param byteorder: Determines the byte order used to represent the
|
||||
integer. If byteorder is ``"big"``, the most significant byte is at
|
||||
the beginning of the byte sequence. If byteorder is ``"little"``,
|
||||
the most significant byte is at the end of the byte sequence.
|
||||
|
||||
:returns: The integer represented by the bytes.
|
||||
|
||||
|
||||
.. pybricks-requirements::
|
||||
|
||||
|
||||
Reference in New Issue
Block a user