Replies: 1 comment 1 reply
-
@lerouxb We don't support implementing properties in native/built-in types. In general however, we achieve the same result by implementing a custom attribute on the type (via the type's Similarly in |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to make a native module that has a simple object hierarchy. Imagine the only global it exposes is "Foo"
you'd then use it like:
so imagine bar and baz in this case are two objects that share a type, each with its own state and some methods.
Looking through the native module documentation and browsing micropython's code I can figure out how to make foo.bar and foo.baz functions or strings or ints, but not other objects. ie. there are lots of examples of achieving foo.bar() and foo.baz(), but what about normal old properties?
Are there any examples somewhere I can copy from? Maybe a project somewhere on the internet that makes more extensive use of native modules?
Beta Was this translation helpful? Give feedback.
All reactions