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
Both the turtle module and the gpiozero module provide classes with a function/method named forward. When you use gpiozero's Robot class, you are shown the docstring for Turtle's forward function:
( You may need to set the env var GPIOZERO_PIN_FACTORY=mock for this to work on a PC )
This seems to be an issue of not having introspection-based autocomplete. If we add Robot.forward() to the API the autocompletion will then offer both alternatives, but e.g. Motor.forward() will still only show whatever we added to the API. Also, it will only show what the API for a given mode includes.
Maybe there's a way to always show what class/module the shown help string is coming from, to make it easy to know when it doesn't apply to a given situation. It does show that information in the autocompletion list, but it's gone from the help.
Reviewing potential conflicts and adding more definitions to the APIs could help.
Both the
turtle
module and thegpiozero
module provide classes with a function/method namedforward
. When you use gpiozero'sRobot
class, you are shown the docstring for Turtle'sforward
function:( You may need to set the env var
GPIOZERO_PIN_FACTORY=mock
for this to work on a PC )The example in turtle's docstring suggests you can use
forward(25)
but gpiozero'sforward
only allows 0->1.This obviously isn't just related to Raspberry Pi, but any module which contains matching function names.
Tangentially related to #590
The text was updated successfully, but these errors were encountered: