Comments (6)
Maybe the solution is to install the source (at least on my PC as the PICO is being accessed remotely) which would provide pylance with the needed information. That seems like a good solution if the actual values exist in the source. That would really help me understand the code and how to use it.
That aside, if Incomplete were changed to int, would that cause a problem?
from micropython-stubber.
I agree that int
would be better, it's just that the tools that turn the source into stubs do not seem to understand the micropython const
directive.
And manual edits across 150+ boards is not something I aspire.
For understanding, the source is better than the stubs, as the stubs never have the implementation.
from micropython-stubber.
Added stubs QA test
- pyright/pylance : Pass
- mypy : has an issue resolving
import aioble.client
from typing import assert_type
import aioble.client # stubs-ignore: linter=="mypy"
assert_type(aioble.client._ADV_TYPE_SHORT_NAME , int) # stubs-ignore: linter=="mypy"
from micropython-stubber.
@brianreinhold,
Thanks for the report.
I updated the stubber tool to allow the types of almost all consts to be preserved during the stubbing process.
That in turn improves the typing across all port and frozen modules.
Updates have been published to PyPI as micropython-rp2-rpi_pico_w-stubs v1.22.1.post2
If you have modified your local stubs, make sure they do not get overwritten by an automatic update.
from micropython-stubber.
That is really helpful. I have replaced the stubs with the source in the .vscode directory (aioble only) such that pylance references the source. The source still has a lot of None
s where a typing would be much more helpful. As I figure out what they are, I update them.
from micropython-stubber.
Some parts are sparsely documented, or in a way that I currently can't parse.
If you have a set that you think is useful I'd be happy to take a copy (in a gist or something) and try to find a way to integrate them.
from micropython-stubber.
Related Issues (20)
- MPFlash unnecessarily verbose error message HOT 2
- MPFlash list output doesn't fit a standard terminal HOT 4
- mpflash: rp2 download fails HOT 3
- Mpflash error flashing blank esp32
- Mpflash error flashing. UF2 on macos HOT 1
- MPflash: unable to flash rp2040 /.uf2 on macos HOT 13
- mpflash: does not identify 'ESP32 module with ESP32' v1.13 HOT 1
- mpflash: Failing flash without --serial HOT 4
- mpflash: Improve HTTP error handling HOT 3
- Mpflash - : use 1200 Bd to reset boards to bootloader HOT 2
- Add tls module HOT 1
- mpflash: unable to download PICO firmware due to changed BOARD_ID HOT 4
- mpflash: non-zero return code to indicate no device found HOT 7
- MPFlash: Failed flash in CI should return error HOT 1
- stubber createstubs aborts on error while stubbing one board
- MPFlash: ask_input tests fail in CI
- MPFlash: implement erase for RPI_PICO and other boards
- stubber: get_frozen fails for ARDUINO boards that depend on arduino_lib HOT 1
- mpflash: Add merge option
- stubber: malformed usocket.pyi
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 micropython-stubber.