summaryrefslogtreecommitdiff
path: root/shared-bindings/nvm/ByteArray.c
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2020-08-02 11:36:38 -0400
committerDan Halbert <halbert@halwitz.org>2020-08-02 11:36:38 -0400
commit0a60aee3e4270d1da42d67f933578d60d56b8b52 (patch)
tree43beede01b4f2d94863f979365c08db64c6be882 /shared-bindings/nvm/ByteArray.c
parenta76ad3415c6aeae7bb9c915f20220d32001e8094 (diff)
parente7a78e08479e412dda16076986924e3b8cb19b75 (diff)
wip: compiles
Diffstat (limited to 'shared-bindings/nvm/ByteArray.c')
-rw-r--r--shared-bindings/nvm/ByteArray.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/shared-bindings/nvm/ByteArray.c b/shared-bindings/nvm/ByteArray.c
index 06d7d4c95..994ce7045 100644
--- a/shared-bindings/nvm/ByteArray.c
+++ b/shared-bindings/nvm/ByteArray.c
@@ -44,12 +44,15 @@
//| microcontroller.nvm[0:3] = b\"\xcc\x10\x00\""""
//|
-//| def __init__(self, ):
+//| def __init__(self) -> None:
//| """Not currently dynamically supported. Access the sole instance through `microcontroller.nvm`."""
//| ...
//|
-//| def __len__(self, ) -> Any:
+//| def __bool__(self) -> bool:
+//| ...
+//|
+//| def __len__(self) -> int:
//| """Return the length. This is used by (`len`)"""
//| ...
//|
@@ -68,6 +71,18 @@ STATIC const mp_rom_map_elem_t nvm_bytearray_locals_dict_table[] = {
STATIC MP_DEFINE_CONST_DICT(nvm_bytearray_locals_dict, nvm_bytearray_locals_dict_table);
+//| @overload
+//| def __getitem__(self, index: slice) -> bytearray: ...
+//| def __getitem__(self, index: int) -> int:
+//| """Returns the value at the given index."""
+//| ...
+//|
+//| @overload
+//| def __setitem__(self, index: slice, value: ReadableBuffer) -> None: ...
+//| def __setitem__(self, index: int, value: int) -> None:
+//| """Set the value at the given index."""
+//| ...
+//|
STATIC mp_obj_t nvm_bytearray_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value) {
if (value == MP_OBJ_NULL) {
// delete item