DeprecationWarning: an integer is required (got type pydrake.systems.framework.InputPortIndex). Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
return LinearQuadraticRegulator(plant, context,`
... the LQR method indeed takes an int for (possible) use as an input port index. Of course I can do the cast here, but is this a widespread pattern that we need to fix?
I'm not sure where this arises (CPython / Python, or pybind11), but once we identify it, two possible solutions may just be:
Use a different spelling, such as __long__
Workaround it in bindings (either just binding InputPortIndex1 flavor, or add some utilities so that our pybind11 bindings can still do it)
Russ - I assume this was encountered in CPython 3.7 via Google Colab?
From @RussTedrake on Slack: https://drakedevelopers.slack.com/archives/C3YB3EV5W/p1619088373041800
I'm not sure where this arises (CPython / Python, or
pybind11
), but once we identify it, two possible solutions may just be:__long__
InputPortIndex1
flavor, or add some utilities so that our pybind11 bindings can still do it)Russ - I assume this was encountered in CPython 3.7 via Google Colab?