You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
@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.
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.
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.)
Actually I think since the two linked PRs merged it's possible to pass either an
int
or aPin
instance across all ports.Definitely the case described in the original report works now, it's possible to do either
machine.ADC(int)
ormachine.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)
The text was updated successfully, but these errors were encountered: