summaryrefslogtreecommitdiff
path: root/shared-bindings/nvm/ByteArray.c
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2020-07-27 14:26:54 -0700
committerGitHub <noreply@github.com>2020-07-27 14:26:54 -0700
commit7be9837f732f11424cbcc531728b231b3bceae94 (patch)
treec2be81826b36ef78c09a05be2167360f5f341fab /shared-bindings/nvm/ByteArray.c
parent7ab5c520e6d52ddad9ca11a72ba0aa170d3d280b (diff)
parentd356581651e4a11dc18787da95e2f96bfde3575d (diff)
Merge pull request #3193 from ciscorn/type-annotations
More type hints
Diffstat (limited to 'shared-bindings/nvm/ByteArray.c')
-rw-r--r--shared-bindings/nvm/ByteArray.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/shared-bindings/nvm/ByteArray.c b/shared-bindings/nvm/ByteArray.c
index 278ac4d73..994ce7045 100644
--- a/shared-bindings/nvm/ByteArray.c
+++ b/shared-bindings/nvm/ByteArray.c
@@ -49,7 +49,8 @@
//| ...
//|
-//| def __bool__(self) -> bool: ...
+//| def __bool__(self) -> bool:
+//| ...
//|
//| def __len__(self) -> int:
//| """Return the length. This is used by (`len`)"""
@@ -70,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