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

RP2040 NeoPixel __setitem__ is missing #264

Closed
DeflateAwning opened this issue Nov 21, 2024 · 4 comments
Closed

RP2040 NeoPixel __setitem__ is missing #264

DeflateAwning opened this issue Nov 21, 2024 · 4 comments
Labels
bug Something isn't working stubs

Comments

@DeflateAwning
Copy link
Contributor

The NeoPixel example from the MicroPython rp2 docs is as follows:

from machine import Pin
from neopixel import NeoPixel

pin = Pin(0, Pin.OUT)   # set GPIO0 to output to drive NeoPixels
np = NeoPixel(pin, 8)   # create NeoPixel driver on GPIO0 for 8 pixels
np[0] = (255, 255, 255) # set the first pixel to white
np.write()              # write data to all pixels
r, g, b = np[0]         # get first pixel colour

The example gives a warning on the np[0] = (255, ...) line, because it can't find the __setitem__ method of the NeoPixel class.

@DeflateAwning DeflateAwning added the bug Something isn't working label Nov 21, 2024
@Josverl
Copy link

Josverl commented Nov 23, 2024

You are correct that the type stubs are incomplete here.
I'm aware of this and tracking it.
I'm doing a significant change to to add overloads to the stubs, and the fix to this will follow that one.

The code will run, but you may want to add a # type:ignore for now.

Josverl/micropython-stubs#764

@paulober paulober added the stubs label Nov 24, 2024
@DeflateAwning
Copy link
Contributor Author

DeflateAwning commented Nov 25, 2024

Ah oops, I totally opened that on the wrong repo; my bad. Thanks a lot!

Update: Upvote this issue - Josverl/micropython-stubs#764

@DeflateAwning DeflateAwning closed this as not planned Won't fix, can't repro, duplicate, stale Nov 25, 2024
@maxi07
Copy link

maxi07 commented Dec 23, 2024

Just found this issue, hope this will get updated soon!

@Josverl
Copy link

Josverl commented Dec 25, 2024

Please add your vote on the micropython-stub* repo to give me better visibility on these and other improvements on stubs, as i normally stop monitoring closed issues.

See linked issue above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stubs
Projects
None yet
Development

No branches or pull requests

4 participants