Comments (8)
I don't think we should change our libraries for this. Data descriptors simplify the drivers a bunch.
Would you mind opening an issue in MicroPython's repo for them to enable it? They should be interested in having our libraries compatible. I can follow up on it as well.
from adafruit_blinka.
I'm taking Damien's inline comment...
// This costs some code size and makes all load attrs and store attrs slow
...and the statements at https://github.com/micropython/micropython/wiki/Differences to mean they have already decided to exclude it by default, so I think the debate has been had once and settled in favour of performance and resource-efficiency, given there are always substitute language structures.
Do you think we should open it as an issue in any case to record the decision?
BTW I am not proposing that libraries are changed. Rather that people running on Micropython would have to run a post-load monkey-patching operation to switch descriptors for properties on classes where they are found. This would be after import and before use, and not require any code-changes to the module source. Not sure when and how this strategy might fail, though. E.g. are frozen-modules any different in terms of dynamic manipulation. It might be a crazy thought until I've worked through it.
from adafruit_blinka.
I think opening an issue is still worth while. That decision was made before we had 50+ libraries. :-) Determining the code size increase would be a good piece of info to have too.
What would they switch the descriptors to? Properties are implemented using data descriptors.
Frozen modules won't be an issue because we're assuming its a MicroPython build. mpy files are identical to py files after load.
from adafruit_blinka.
What would they switch the descriptors to? Properties are implemented using data descriptors.
I'm just picking up on the https://github.com/micropython/micropython/wiki/Differences comment;
"So far, we were able to implement all native Python features (like properties) without explicit descriptors."
If it's not been covered again recently I'll open an issue.
from adafruit_blinka.
Ancient discussion of strategy for implementing properties at micropython/micropython#474 and
https://github.com/micropython/micropython/blob/6e675c1baaf0de0d56a2345376d6b5600bfab3aa/py/mpconfig.h shows properties configured by default across all current builds, so the property patching strategy should be feasible if no official descriptor support (or while waiting for it).
from adafruit_blinka.
You can find the issue on enabling descriptor support on official images as recently raised at https://github.com/micropython/micropython/issues?utf8=%E2%9C%93&q=is%3Aissue+descriptor
from adafruit_blinka.
Upstream issue is micropython/micropython#3644 and I've subscribed to it. Thanks!
from adafruit_blinka.
Closing as it appears descriptors were added.
from adafruit_blinka.
Related Issues (20)
- New issue HOT 1
- Jetson Nano -- AttributeError: module 'adafruit_platformdetect.constants.chips' has no attribute 'JH71x0' HOT 2
- FT232H not being recognized in PowerShell HOT 4
- Issue with APDS9960 sensor on Raspberry Pi 3 Model B+ HOT 1
- Add board: BOARD=orangepi3-lts HOT 1
- ADD BANANAPI CM4 BOARD
- ADD BANANAPI CM4 BOARD SUPPORT
- DietPi - Error installing Adafruit-Blinka HOT 1
- any check scripts that should be performed before issuing a PR for adding a new board
- Adafruit-PlatformDetect version 3.66.0 was unable to identify the board HOT 3
- Cant find the board HOT 5
- Some microcontroller definitions may be incorrect.
- libgpiod_pin_1_x.py does not detect internal pulldowns HOT 1
- GT911 touch sensor support for Adafruit Blinka HOT 7
- adafruit-circuitpython-motor fails with "RuntimeError: Cannot determine SOC peripheral base address" on Raspberry Pi 5 HOT 12
- Adafruit-Adafruit-PlatformDetect version 3.69.0 was unable to identify the board HOT 13
- Adafruit-PlatformDetect version 3.69.0 was unable to identify the board HOT 2
- support for NXP i.MX 8M PLUS HOT 3
- pip try to install sysv-ipc on Windows HOT 26
- It is no longer possible to install from 8.44.0. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adafruit_blinka.