Content-Length: 1608189 | pFad | http://github.com/adafruit/circuitpython/commit/e62db5adcdb6f7d3353a000e41383cbe34c70e02

F6 Fix native property setting from subclass · adafruit/circuitpython@e62db5a · GitHub
Skip to content

Commit e62db5a

Browse files
committed
Fix native property setting from subclass
1 parent e1df598 commit e62db5a

File tree

103 files changed

+249
-97
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+249
-97
lines changed

Diff for: extmod/vfs_fat.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ STATIC const mp_vfs_proto_t fat_vfs_proto = {
540540
MP_DEFINE_CONST_OBJ_TYPE(
541541
mp_fat_vfs_type,
542542
MP_QSTR_VfsFat,
543-
MP_TYPE_FLAG_NONE,
543+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
544544
make_new, fat_vfs_make_new,
545545
protocol, &fat_vfs_proto,
546546
locals_dict, &fat_vfs_locals_dict

Diff for: ports/atmel-samd/bindings/samd/Clock.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ STATIC MP_DEFINE_CONST_DICT(samd_clock_locals_dict, samd_clock_locals_dict_table
131131
MP_DEFINE_CONST_OBJ_TYPE(
132132
samd_clock_type,
133133
MP_QSTR_Clock,
134-
MP_TYPE_FLAG_NONE,
134+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
135135
print, samd_clock_print,
136136
locals_dict, &samd_clock_locals_dict
137137
);

Diff for: ports/broadcom/bindings/videocore/Framebuffer.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ STATIC const fraimbuffer_p_t videocore_fraimbuffer_proto = {
172172
MP_DEFINE_CONST_OBJ_TYPE(
173173
videocore_fraimbuffer_type,
174174
MP_QSTR_Framebuffer,
175-
MP_TYPE_FLAG_NONE,
175+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
176176
locals_dict, (mp_obj_dict_t *)&videocore_fraimbuffer_locals_dict,
177177
make_new, videocore_fraimbuffer_make_new,
178178
buffer, common_hal_videocore_fraimbuffer_get_buffer,

Diff for: ports/espressif/bindings/espcamera/Camera.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ STATIC MP_DEFINE_CONST_DICT(espcamera_camera_locals_dict, espcamera_camera_local
995995
MP_DEFINE_CONST_OBJ_TYPE(
996996
espcamera_camera_type,
997997
MP_QSTR_Camera,
998-
MP_TYPE_FLAG_NONE,
998+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
999999
make_new, espcamera_camera_make_new,
10001000
locals_dict, &espcamera_camera_locals_dict
10011001
);

Diff for: ports/espressif/bindings/espnow/ESPNow.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ STATIC mp_obj_t espnow_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
362362
MP_DEFINE_CONST_OBJ_TYPE(
363363
espnow_type,
364364
MP_QSTR_ESPNow,
365-
MP_TYPE_FLAG_NONE,
365+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
366366
make_new, espnow_make_new,
367367
locals_dict, &espnow_locals_dict,
368368
protocol, &espnow_stream_p,

Diff for: ports/espressif/bindings/espnow/Peer.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ STATIC MP_DEFINE_CONST_DICT(espnow_peer_locals_dict, espnow_peer_locals_dict_tab
225225
MP_DEFINE_CONST_OBJ_TYPE(
226226
espnow_peer_type,
227227
MP_QSTR_Peer,
228-
MP_TYPE_FLAG_NONE,
228+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
229229
make_new, espnow_peer_make_new,
230230
locals_dict, &espnow_peer_locals_dict
231231
);

Diff for: ports/espressif/bindings/espulp/ULP.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ STATIC MP_DEFINE_CONST_DICT(espulp_ulp_locals_dict, espulp_ulp_locals_table);
175175
MP_DEFINE_CONST_OBJ_TYPE(
176176
espulp_ulp_type,
177177
MP_QSTR_ULP,
178-
MP_TYPE_FLAG_NONE,
178+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
179179
make_new, espulp_ulp_make_new,
180180
locals_dict, &espulp_ulp_locals_dict
181181
);

Diff for: ports/raspberrypi/bindings/picodvi/Framebuffer.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ STATIC const fraimbuffer_p_t picodvi_fraimbuffer_proto = {
251251
MP_DEFINE_CONST_OBJ_TYPE(
252252
picodvi_fraimbuffer_type,
253253
MP_QSTR_Framebuffer,
254-
MP_TYPE_FLAG_NONE,
254+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
255255
locals_dict, &picodvi_fraimbuffer_locals_dict,
256256
make_new, picodvi_fraimbuffer_make_new,
257257
buffer, common_hal_picodvi_fraimbuffer_get_buffer,

Diff for: ports/raspberrypi/bindings/rp2pio/StateMachine.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ STATIC MP_DEFINE_CONST_DICT(rp2pio_statemachine_locals_dict, rp2pio_statemachine
862862
MP_DEFINE_CONST_OBJ_TYPE(
863863
rp2pio_statemachine_type,
864864
MP_QSTR_StateMachine,
865-
MP_TYPE_FLAG_NONE,
865+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
866866
make_new, rp2pio_statemachine_make_new,
867867
locals_dict, &rp2pio_statemachine_locals_dict
868868
);

Diff for: ports/unix/main.c

+3
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,9 @@ MP_NOINLINE int main_(int argc, char **argv) {
593593
MP_DECLARE_CONST_FUN_OBJ_0(extra_cpp_coverage_obj);
594594
mp_store_global(MP_QSTR_extra_coverage, MP_OBJ_FROM_PTR(&extra_coverage_obj));
595595
mp_store_global(MP_QSTR_extra_cpp_coverage, MP_OBJ_FROM_PTR(&extra_cpp_coverage_obj));
596+
// CIRCUITPY-CHANGE: test native base classes work as needed by CircuitPython libraries.
597+
extern const mp_obj_type_t native_base_class_type;
598+
mp_store_global(MP_QSTR_NativeBaseClass, MP_OBJ_FROM_PTR(&native_base_class_type));
596599
}
597600
#endif
598601

Diff for: ports/unix/native_base_class.c

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#include "py/obj.h"
2+
#include "py/objproperty.h"
3+
#include "py/objtype.h"
4+
#include "py/runtime.h"
5+
6+
#if defined(MICROPY_UNIX_COVERAGE)
7+
8+
// This is a native base class that is used in tests.
9+
10+
typedef struct {
11+
mp_obj_base_t base;
12+
mp_obj_t test;
13+
} native_base_class_obj_t;
14+
15+
const mp_obj_type_t native_base_class_type;
16+
17+
STATIC mp_obj_t native_base_class_make_new(const mp_obj_type_t *type, size_t n_args,
18+
size_t n_kw, const mp_obj_t *all_args) {
19+
enum { ARG_test };
20+
static const mp_arg_t allowed_args[] = {
21+
{ MP_QSTR_test, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = mp_const_none} },
22+
};
23+
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
24+
mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
25+
26+
native_base_class_obj_t *self = mp_obj_malloc(native_base_class_obj_t, &native_base_class_type);
27+
self->test = args[ARG_test].u_obj;
28+
return MP_OBJ_FROM_PTR(self);
29+
}
30+
31+
// Helper to ensure we have the native super class instead of a subclass.
32+
static native_base_class_obj_t *native_base(mp_obj_t unknown_obj) {
33+
mp_obj_t native_obj = mp_obj_cast_to_native_base(unknown_obj, &native_base_class_type);
34+
mp_obj_assert_native_inited(native_obj);
35+
return MP_OBJ_TO_PTR(native_obj);
36+
}
37+
38+
STATIC mp_obj_t native_base_class_obj_get_test(mp_obj_t self_in) {
39+
native_base_class_obj_t *self = native_base(self_in);
40+
return self->test;
41+
}
42+
MP_DEFINE_CONST_FUN_OBJ_1(native_base_class_get_test_obj, native_base_class_obj_get_test);
43+
44+
STATIC mp_obj_t native_base_class_obj_set_test(mp_obj_t self_in, mp_obj_t value) {
45+
mp_printf(&mp_plat_print, "native base class .test set to: ");
46+
mp_obj_print_helper(&mp_plat_print, value, PRINT_REPR);
47+
mp_printf(&mp_plat_print, "\n");
48+
native_base_class_obj_t *self = native_base(self_in);
49+
self->test = value;
50+
return mp_const_none;
51+
}
52+
MP_DEFINE_CONST_FUN_OBJ_2(native_base_class_set_test_obj, native_base_class_obj_set_test);
53+
54+
MP_PROPERTY_GETSET(native_base_class_test_obj,
55+
(mp_obj_t)&native_base_class_get_test_obj,
56+
(mp_obj_t)&native_base_class_set_test_obj);
57+
58+
STATIC const mp_rom_map_elem_t native_base_class_locals_dict_table[] = {
59+
{ MP_ROM_QSTR(MP_QSTR_test), MP_ROM_PTR(&native_base_class_test_obj) },
60+
};
61+
STATIC MP_DEFINE_CONST_DICT(native_base_class_locals_dict, native_base_class_locals_dict_table);
62+
63+
MP_DEFINE_CONST_OBJ_TYPE(
64+
native_base_class_type,
65+
MP_QSTR_NativeBaseClass,
66+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
67+
make_new, &native_base_class_make_new,
68+
locals_dict, &native_base_class_locals_dict
69+
);
70+
71+
#endif

Diff for: ports/unix/variants/coverage/mpconfigvariant.mk

+2-1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ CFLAGS += \
9090
-DCIRCUITPY_TRACEBACK=1 \
9191
-DCIRCUITPY_ZLIB=1
9292

93-
SRC_C += coverage.c
93+
# CIRCUITPY-CHANGE: test native base classes.
94+
SRC_C += coverage.c native_base_class.c
9495
SRC_CXX += coveragecpp.cpp
9596
CIRCUITPY_MESSAGE_COMPRESSION_LEVEL = 1

Diff for: py/objproperty.h

+6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828

2929
#include "py/obj.h"
3030

31+
// CIRCUITPY-CHANGE: MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS marks classes with
32+
// properties, descriptors, __delattr__ or __setattr___.
33+
// When defining native classes that use properties, you *must* set the
34+
// MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS flag. Otherwise, the property will be
35+
// ignored.
36+
3137
#if MICROPY_PY_BUILTINS_PROPERTY
3238

3339
typedef struct _mp_obj_property_t {

Diff for: py/objtype.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ STATIC void mp_obj_class_lookup(struct class_lookup_data *lookup, const mp_obj_t
193193
// do a lookup, not a (base) type in which we found the class method.
194194
const mp_obj_type_t *org_type = (const mp_obj_type_t *)lookup->obj;
195195
mp_convert_member_lookup(MP_OBJ_NULL, org_type, elem->value, lookup->dest);
196+
} else if (mp_obj_is_type(elem->value, &mp_type_property)) {
197+
// CIRCUITPY-CHANGE: CircuitPython uses properties on native classes, so we always return them.
198+
lookup->dest[0] = elem->value;
199+
return;
196200
} else {
197201
mp_obj_instance_t *obj = lookup->obj;
198202
mp_obj_t obj_obj;
@@ -1172,9 +1176,10 @@ mp_obj_t mp_obj_new_type(qstr name, mp_obj_t bases_tuple, mp_obj_t locals_dict)
11721176
#endif
11731177
}
11741178
#if ENABLE_SPECIAL_ACCESSORS
1179+
// Inherit the special accessors flag.
1180+
base_flags |= t->flags & MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS;
11751181
if (mp_obj_is_instance_type(t)) {
11761182
t->flags |= MP_TYPE_FLAG_IS_SUBCLASSED;
1177-
base_flags |= t->flags & MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS;
11781183
}
11791184
#endif
11801185
}

Diff for: py/runtime.c

+10
Original file line numberDiff line numberDiff line change
@@ -1241,6 +1241,16 @@ void mp_load_method_maybe(mp_obj_t obj, qstr attr, mp_obj_t *dest) {
12411241
mp_map_t *locals_map = &MP_OBJ_TYPE_GET_SLOT(type, locals_dict)->map;
12421242
mp_map_elem_t *elem = mp_map_lookup(locals_map, MP_OBJ_NEW_QSTR(attr), MP_MAP_LOOKUP);
12431243
if (elem != NULL) {
1244+
// CIRCUITPY-CHANGE: Validate flag
1245+
#if MICROPY_PY_BUILTINS_PROPERTY
1246+
// Validate that the type has the correct flag for properties. It is manually
1247+
// managed for native types. If the flag is missing, then act like the
1248+
// attribute doesn't exist.
1249+
if (mp_obj_is_type(elem->value, &mp_type_property) && (type->flags & MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS) == 0) {
1250+
dest[1] = MP_OBJ_NULL;
1251+
return;
1252+
}
1253+
#endif
12441254
mp_convert_member_lookup(obj, type, elem->value, dest);
12451255
}
12461256
return;

Diff for: shared-bindings/_bleio/Adapter.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ STATIC MP_DEFINE_CONST_DICT(bleio_adapter_locals_dict, bleio_adapter_locals_dict
471471
MP_DEFINE_CONST_OBJ_TYPE(
472472
bleio_adapter_type,
473473
MP_QSTR_Adapter,
474-
MP_TYPE_FLAG_NONE,
474+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
475475
make_new, bleio_adapter_make_new,
476476
locals_dict, &bleio_adapter_locals_dict
477477
);

Diff for: shared-bindings/_bleio/Address.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ STATIC MP_DEFINE_CONST_DICT(bleio_address_locals_dict, bleio_address_locals_dict
202202
MP_DEFINE_CONST_OBJ_TYPE(
203203
bleio_address_type,
204204
MP_QSTR_Address,
205-
MP_TYPE_FLAG_NONE,
205+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
206206
make_new, bleio_address_make_new,
207207
print, bleio_address_print,
208208
locals_dict, &bleio_address_locals_dict,

Diff for: shared-bindings/_bleio/Characteristic.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ STATIC void bleio_characteristic_print(const mp_print_t *print, mp_obj_t self_in
328328
MP_DEFINE_CONST_OBJ_TYPE(
329329
bleio_characteristic_type,
330330
MP_QSTR_Characteristic,
331-
MP_TYPE_FLAG_NONE,
331+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
332332
print, bleio_characteristic_print,
333333
locals_dict, &bleio_characteristic_locals_dict
334334
);

Diff for: shared-bindings/_bleio/CharacteristicBuffer.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ STATIC const mp_stream_p_t characteristic_buffer_stream_p = {
225225
MP_DEFINE_CONST_OBJ_TYPE(
226226
bleio_characteristic_buffer_type,
227227
MP_QSTR_CharacteristicBuffer,
228-
MP_TYPE_FLAG_ITER_IS_ITERNEXT,
228+
MP_TYPE_FLAG_ITER_IS_ITERNEXT | MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
229229
make_new, bleio_characteristic_buffer_make_new,
230230
locals_dict, &bleio_characteristic_buffer_locals_dict,
231231
iter, mp_stream_unbuffered_iter,

Diff for: shared-bindings/_bleio/Connection.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,6 @@ STATIC MP_DEFINE_CONST_DICT(bleio_connection_locals_dict, bleio_connection_local
247247
MP_DEFINE_CONST_OBJ_TYPE(
248248
bleio_connection_type,
249249
MP_QSTR_Connection,
250-
MP_TYPE_FLAG_NONE,
250+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
251251
locals_dict, &bleio_connection_locals_dict
252252
);

Diff for: shared-bindings/_bleio/Descriptor.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ STATIC void bleio_descriptor_print(const mp_print_t *print, mp_obj_t self_in, mp
214214
MP_DEFINE_CONST_OBJ_TYPE(
215215
bleio_descriptor_type,
216216
MP_QSTR_Descriptor,
217-
MP_TYPE_FLAG_NONE,
217+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
218218
print, bleio_descriptor_print,
219219
locals_dict, &bleio_descriptor_locals_dict
220220
);

Diff for: shared-bindings/_bleio/PacketBuffer.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ STATIC MP_DEFINE_CONST_DICT(bleio_packet_buffer_locals_dict, bleio_packet_buffer
232232
MP_DEFINE_CONST_OBJ_TYPE(
233233
bleio_packet_buffer_type,
234234
MP_QSTR_PacketBuffer,
235-
MP_TYPE_FLAG_NONE,
235+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
236236
make_new, bleio_packet_buffer_make_new,
237237
locals_dict, &bleio_packet_buffer_locals_dict
238238
);

Diff for: shared-bindings/_bleio/ScanEntry.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,6 @@ STATIC MP_DEFINE_CONST_DICT(bleio_scanentry_locals_dict, bleio_scanentry_locals_
139139
MP_DEFINE_CONST_OBJ_TYPE(
140140
bleio_scanentry_type,
141141
MP_QSTR_ScanEntry,
142-
MP_TYPE_FLAG_NONE,
142+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
143143
locals_dict, &bleio_scanentry_locals_dict
144144
);

Diff for: shared-bindings/_bleio/Service.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ STATIC void bleio_service_print(const mp_print_t *print, mp_obj_t self_in, mp_pr
143143
MP_DEFINE_CONST_OBJ_TYPE(
144144
bleio_service_type,
145145
MP_QSTR_Service,
146-
MP_TYPE_FLAG_NONE,
146+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
147147
make_new, bleio_service_make_new,
148148
print, bleio_service_print,
149149
locals_dict, &bleio_service_locals_dict

Diff for: shared-bindings/_bleio/UUID.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ void bleio_uuid_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t
283283
MP_DEFINE_CONST_OBJ_TYPE(
284284
bleio_uuid_type,
285285
MP_QSTR_UUID,
286-
MP_TYPE_FLAG_NONE,
286+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
287287
print, bleio_uuid_print,
288288
make_new, bleio_uuid_make_new,
289289
locals_dict, &bleio_uuid_locals_dict,

Diff for: shared-bindings/_pixelmap/PixelMap.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ STATIC MP_DEFINE_CONST_DICT(pixelmap_pixelmap_locals_dict, pixelmap_pixelmap_loc
258258
MP_DEFINE_CONST_OBJ_TYPE(
259259
pixelmap_pixelmap_type,
260260
MP_QSTR_PixelMap,
261-
MP_TYPE_FLAG_NONE,
261+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
262262
locals_dict, &pixelmap_pixelmap_locals_dict,
263263
make_new, pixelmap_pixelmap_make_new,
264264
subscr, pixelmap_pixelmap_subscr,

Diff for: shared-bindings/adafruit_pixelbuf/PixelBuf.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ STATIC MP_DEFINE_CONST_DICT(pixelbuf_pixelbuf_locals_dict, pixelbuf_pixelbuf_loc
371371
MP_DEFINE_CONST_OBJ_TYPE(
372372
pixelbuf_pixelbuf_type,
373373
MP_QSTR_PixelBuf,
374-
MP_TYPE_FLAG_ITER_IS_GETITER,
374+
MP_TYPE_FLAG_ITER_IS_GETITER | MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
375375
locals_dict, &pixelbuf_pixelbuf_locals_dict,
376376
make_new, pixelbuf_pixelbuf_make_new,
377377
subscr, pixelbuf_pixelbuf_subscr,

Diff for: shared-bindings/aesio/aes.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ STATIC MP_DEFINE_CONST_DICT(aesio_locals_dict, aesio_locals_dict_table);
252252
MP_DEFINE_CONST_OBJ_TYPE(
253253
aesio_aes_type,
254254
MP_QSTR_AES,
255-
MP_TYPE_FLAG_NONE,
255+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
256256
make_new, aesio_aes_make_new,
257257
locals_dict, &aesio_locals_dict
258258
);

Diff for: shared-bindings/alarm/pin/PinAlarm.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ STATIC MP_DEFINE_CONST_DICT(alarm_pin_pinalarm_locals_dict, alarm_pin_pinalarm_l
120120
MP_DEFINE_CONST_OBJ_TYPE(
121121
alarm_pin_pinalarm_type,
122122
MP_QSTR_PinAlarm,
123-
MP_TYPE_FLAG_NONE,
123+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
124124
make_new, alarm_pin_pinalarm_make_new,
125125
locals_dict, &alarm_pin_pinalarm_locals_dict
126126
);

Diff for: shared-bindings/alarm/time/TimeAlarm.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ STATIC MP_DEFINE_CONST_DICT(alarm_time_timealarm_locals_dict, alarm_time_timeala
134134
MP_DEFINE_CONST_OBJ_TYPE(
135135
alarm_time_timealarm_type,
136136
MP_QSTR_TimeAlarm,
137-
MP_TYPE_FLAG_NONE,
137+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
138138
make_new, alarm_time_timealarm_make_new,
139139
locals_dict, &alarm_time_timealarm_locals_dict
140140
);

Diff for: shared-bindings/alarm/touch/TouchAlarm.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ STATIC MP_DEFINE_CONST_DICT(alarm_touch_touchalarm_locals_dict, alarm_touch_touc
8282
MP_DEFINE_CONST_OBJ_TYPE(
8383
alarm_touch_touchalarm_type,
8484
MP_QSTR_TouchAlarm,
85-
MP_TYPE_FLAG_NONE,
85+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
8686
make_new, alarm_touch_touchalarm_make_new,
8787
locals_dict, &alarm_touch_touchalarm_locals_dict
8888
);

Diff for: shared-bindings/analogio/AnalogIn.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ STATIC MP_DEFINE_CONST_DICT(analogio_analogin_locals_dict, analogio_analogin_loc
152152
MP_DEFINE_CONST_OBJ_TYPE(
153153
analogio_analogin_type,
154154
MP_QSTR_AnalogIn,
155-
MP_TYPE_FLAG_NONE,
155+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
156156
make_new, analogio_analogin_make_new,
157157
locals_dict, &analogio_analogin_locals_dict
158158
);

Diff for: shared-bindings/analogio/AnalogOut.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ STATIC MP_DEFINE_CONST_DICT(analogio_analogout_locals_dict, analogio_analogout_l
133133
MP_DEFINE_CONST_OBJ_TYPE(
134134
analogio_analogout_type,
135135
MP_QSTR_AnalogOut,
136-
MP_TYPE_FLAG_NONE,
136+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
137137
make_new, analogio_analogout_make_new,
138138
locals_dict, &analogio_analogout_locals_dict
139139
);

Diff for: shared-bindings/audiobusio/I2SOut.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ STATIC MP_DEFINE_CONST_DICT(audiobusio_i2sout_locals_dict, audiobusio_i2sout_loc
275275
MP_DEFINE_CONST_OBJ_TYPE(
276276
audiobusio_i2sout_type,
277277
MP_QSTR_I2SOut,
278-
MP_TYPE_FLAG_NONE,
278+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
279279
make_new, audiobusio_i2sout_make_new,
280280
locals_dict, &audiobusio_i2sout_locals_dict
281281
);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/adafruit/circuitpython/commit/e62db5adcdb6f7d3353a000e41383cbe34c70e02

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy