Skip to content
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

Remove remaining direct uses of mp_obj_property_t #9660

Open
jepler opened this issue Sep 25, 2024 · 1 comment
Open

Remove remaining direct uses of mp_obj_property_t #9660

jepler opened this issue Sep 25, 2024 · 1 comment

Comments

@jepler
Copy link
Member

jepler commented Sep 25, 2024

We prefer MP_PROPERTY_GETTER and MP_PROPERTY_GETSET, as these can save flash space on some ports and are also more self explanatory

There's not currently a macro for a property that supports deletion. If there's some rare property that supports deletion, we should introduce and use MP_PROPERTY_GETSETDEL for it (albeit maybe with a better name)

@jepler
Copy link
Member Author

jepler commented Sep 25, 2024

ports/raspberrypi/bindings/rp2pio/StateMachine.c:const mp_obj_property_t rp2pio_statemachine_writing_obj = {
ports/raspberrypi/bindings/rp2pio/StateMachine.c:const mp_obj_property_t rp2pio_statemachine_pending_obj = {
ports/raspberrypi/bindings/rp2pio/StateMachine.c:const mp_obj_property_t rp2pio_statemachine_txstall_obj = {
py/objproperty.c:extern const mp_obj_property_t __property_getter_start, __property_getter_end, __property_getset_start, __property_getset_end;
py/objproperty.h:#define MP_PROPERTY_GETTER(P, G) const mp_obj_property_t P = {.base.type = &mp_type_property, .proxy = {G, MP_ROM_NONE, MP_ROM_NONE}}
py/objproperty.h:#define MP_PROPERTY_GETSET(P, G, S) const mp_obj_property_t P = {.base.type = &mp_type_property, .proxy = {G, S, MP_ROM_NONE}}
shared-bindings/displayio/OnDiskBitmap.c:const mp_obj_property_t displayio_ondiskbitmap_pixel_shader_obj = {
shared-bindings/keypad/__init__.c:const mp_obj_property_t keypad_generic_key_count_obj = {
shared-bindings/keypad/__init__.c:const mp_obj_property_t keypad_generic_events_obj = {
shared-bindings/keypad/__init__.h:extern const mp_obj_property_t keypad_generic_events_obj;
shared-bindings/keypad/__init__.h:extern const mp_obj_property_t keypad_generic_key_count_obj;
shared-bindings/vectorio/Rectangle.c:const mp_obj_property_t vectorio_rectangle_width_obj = {
shared-bindings/vectorio/Rectangle.c:const mp_obj_property_t vectorio_rectangle_height_obj = {
shared-bindings/vectorio/Rectangle.c:const mp_obj_property_t vectorio_rectangle_color_index_obj = {

These are the ones I found via grep in a recent revision of circuitpython.

@tannewt tannewt added this to the 10.0.0 milestone Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants