Comments (12)
Those stubs are not maintained by me, and are indeed incorrect.
I think mine are correct,
def __init__(self, scl, sda, *, freq=400000, timeout=50000) -> None:
It should be possible to reconfigure your project to use the more up to date stubs
And/or raise this with the Pico maintainer
from micropython-stubber.
Sorry, wrong repo.
from micropython-stubber.
If this is for micropython stubs then I could move the issue, but not sure if I can understand the question or issue withiuth details of the port board and version of the stubs in that case
from micropython-stubber.
I am using Pico-W-Stub with vscode and when machine.SoftI2C, Pylance ask for one more parameter (the id).
umachine has SoftI2C class with this:
def __init__(self, id: int, /, *, scl: Pin, sda: Pin, freq: int = 400_000):
However, the id parameter should not be there. Removing it solves Pylance error.
I am not really familiar with the structure of stubs nor a Python guy so please let me know if this is clear or not.
from micropython-stubber.
Thanks! I figured out it was not the right repo that's why I closed it. I already raise it to the maintainer but no feedback so far.
I'll read how to switch to your stubs and replace it automatically.
from micropython-stubber.
NP, happy to help
from micropython-stubber.
Quick question about the stub since I could not find answer in the docs: why are there both init (initialize) and init function ? Not sure about the logic behind the duplicate def init()?
from micropython-stubber.
All classes should have an init
I try to deduce the parameter signature from the documentation of the class
https://docs.micropython.org/en/latest/library/machine.I2C.html#machine.SoftI2C
class machine.SoftI2C(scl, sda, *, freq=400000, timeout=50000)
The I2C class also has an init method documented, with a slightly different signature
I2C.init(scl, sda, *, freq=400000)
Perhaps this is a Documentation error?
Have you tested if the SoftI2C class accepts/has both methods?
On the board firmware I find the SoftI2C method is reported as having the init method
from micropython-stubber.
You are right and the documentation is right. I did not see it at first because I only looked at RP2 port and not the general documentation!
from micropython-stubber.
Do you have a link to the page with the wrong info?
Then I can send a PR to correct the docs
from micropython-stubber.
I searched but what I see now is correct. The only thing I can think about is I may have looked at an older version of the doc. Thanks for your patience!
from micropython-stubber.
No problem 👍
from micropython-stubber.
Related Issues (20)
- automatic releases
- getinfo: determine boardname of firmware HOT 1
- mypy updates fail to create stubs of (older) uasyncio version HOT 1
- Generating lvgl stubs using documentation HOT 8
- Update micopython-lib matching for v1.12.0 or newer
- Update handling of u-modules in 1.20.1 and up HOT 2
- Check/Update latest stubs version numbering
- Fix bare const using __builtins__.py - pyright/pylance HOT 2
- Document how to generate stubs for a branch or fork of MicroPython? HOT 12
- Try rich-click for nicer UX
- improve typing for 'underdocumented' `__init__` methods
- from _typeshed import Incomplete
- fix class SoftSPI(SPI) error as SPI defined later ( reorder / different syntax) HOT 1
- Merge docstring for Literals from the documentation into the stub files
- Consider the "Any trick"
- stubber build: Incorrect package versions When specifying multiple versions to be build at the same time
- BTLE low-level constants defined as 'Incomplete' HOT 6
- Should constant values be included in stub files
- Find simple way to add more documentation by the community
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.