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:
Laurens Valk
2021-08-22 12:15:42 +02:00
parent a0f4818e26
commit dd2e6e8603
+19
View File
@@ -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::