Skip to content

objtype: Restore our customized behavior of instance_subscr #4688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ports/atmel-samd/boards/feather_m0_express/mpconfigboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@
#define DEFAULT_UART_BUS_RX (&pin_PA11)
#define DEFAULT_UART_BUS_TX (&pin_PA10)

// Other some pins that do not appear in the pinout & are not used internally
// this list is not (yet) exhaustive
#define IGNORE_PIN_PA03 1
#define IGNORE_PIN_PB01 1
#define IGNORE_PIN_PB03 1
#define IGNORE_PIN_PB04 1
#define IGNORE_PIN_PB05 1
#define IGNORE_PIN_PB06 1
#define IGNORE_PIN_PB07 1
#define IGNORE_PIN_PB12 1

// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
15 changes: 15 additions & 0 deletions ports/atmel-samd/boards/snekboard/mpconfigboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@
#define DEFAULT_UART_BUS_RX (&pin_PB08) /* ANALOG 1 */
#define DEFAULT_UART_BUS_TX (&pin_PB09) /* ANALOG 2 */

// Other some pins that do not appear in the pinout & are not used internally
// this list is not (yet) exhaustive
#define IGNORE_PIN_PA01 1
#define IGNORE_PIN_PA03 1
#define IGNORE_PIN_PB04 1
#define IGNORE_PIN_PB05 1
#define IGNORE_PIN_PB00 1
#define IGNORE_PIN_PB01 1
#define IGNORE_PIN_PB02 1
#define IGNORE_PIN_PB04 1
#define IGNORE_PIN_PB05 1
#define IGNORE_PIN_PB06 1
#define IGNORE_PIN_PB07 1
#define IGNORE_PIN_PB12 1

// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
3 changes: 2 additions & 1 deletion py/objtype.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,8 @@ STATIC mp_obj_t instance_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value
}
mp_obj_class_lookup(&lookup, self->base.type);
if (member[0] == MP_OBJ_SENTINEL) {
mp_obj_t ret = mp_obj_subscr(self->subobj[0], index, value);
mp_obj_type_t *subobj_type = mp_obj_get_type(self->subobj[0]);
mp_obj_t ret = subobj_type->subscr(self_in, index, value);
// May have called port specific C code. Make sure it didn't mess up the heap.
assert_heap_ok();
return ret;
Expand Down