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

Verify stub signatures for passing either an int or a Pin instance across all ports. #768

Open
Josverl opened this issue Nov 20, 2024 · 4 comments

Comments

@Josverl
Copy link
Owner

Josverl commented Nov 20, 2024

Actually I think since the two linked PRs merged it's possible to pass either an int or a Pin instance across all ports.

Definitely the case described in the original report works now, it's possible to do either machine.ADC(int) or machine.ADC(machine.Pin(int)) and the former will degrade into the latter.

If someone runs across a machine API which requires a Pin object and doesn't accept an int, suggest they open a new issue and we can change it to use the existing helper functions internally.

Originally posted by @projectgus in micropython/micropython#4379 (comment)

@projectgus
Copy link

@Josverl Are you planning to check this? I'm not sure it's worth tracking in an issue otherwise unless someone plans to do it, AFAIK it's already been covered by the PRs linked to the original issue.

@Josverl
Copy link
Owner Author

Josverl commented Nov 20, 2024

I plan to check if the stub signatures match this behavior, especially as I'm currently working to integrate method parameter typing and @Overloads, and I think that something as essential as Pins should be well represented in the type stubs.

Therefore I'm tracking it as a todo in the MicoPython-stubs repo.

@projectgus
Copy link

Sounds great!

@projectgus
Copy link

Oh, I'd also missed this is the micropython-stubs repo. My mistake. 🤦

(Because it mentioned me I got an email notification for it that showed up with all my other MP related notifications, and I totally missed that we're no longer in the micropython org. No worries.)

Josverl added a commit that referenced this issue Nov 28, 2024
Josverl added a commit that referenced this issue Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants