Replies: 2 comments
-
Hi! @beneisner |
Beta Was this translation helpful? Give feedback.
-
@beneisner I have found a workaround to this. Apparently, Pylance does not do this on its own. See Pylance#663. However, I have extracted what seems to be a full stub_file using PyCharm. Just place the stub file in your top-level directory in VS Code, and voila! A workaround, but better than nothing. |
Beta Was this translation helpful? Give feedback.
-
Hi,
tl;dr: Would it be possible to add a Python stub file to Pybullet, so that IDEs can enable Intellisense/Autocomplete w/ Pybullet? I would be happy to contribute this.
I've been using Pybullet a lot in my manipulation research, and I've really appreciated how straightforward and clear the API is. Especially helpful is the Quickstart document!
However, one aspect that seems to slow down my development when using Pybullet is the apparent lack of a declared API that can be consumed by IDEs. For instance, most Python libraries that are written in native Python can be inspected by an IDE, and their functions can be suggested for autocomplete or Intellisense. However, the way that Pybullet wraps Bullet, it would seem that the names of functions are not exposed without loading the entire package (i.e. functions are resolved at runtime, but not exposed to editors, which simply inspect the source files).
One potential way to expose the member functions and values to IDEs is to write a separate Python stub file, which would allow for Pybullet to declare the signatures of the functions it exports and their parameters in a separate file (with extension
.pyi
) in a way that can be consumed at development time by IDEs.I already have a partially-completed version of the stub file that I use personally when developing w/ Pybullet, and I'd be happy to clean it up and upstream it that would be welcome.
Thanks,
Ben Eisner
Beta Was this translation helpful? Give feedback.
All reactions