Hi,
I am wondering about the correct usage of the Rhino-Stubs within an outside IDE when writing Python? Specifically, VSCode. I am able to pip install the stubs just fine, and they are mostly recognized properly, but for some reason the the modules listed in the stub-file’s __all__
are not being recognized, and I wonder if I should be setting this up differently to make it work as expected?
For instance, in VSCode, if I do something like:
from Rhino import Geometry
class MyClass(object):
def __init__(self, _geom):
# type: (list[Geometry.GeometryBase]) -> None
self.geom = _geom
then it can find Rhino
(I can Command-Click and follow the Rhino ref successfully), but not Geometry
, even though .Geometry
is listed within the stub __all__
:
In VSCode, Rhino.___
autocomplete lists the only classes within the file, as expected, but not the ones in __all__
:
Does anyone know of a solution there that I am missing? I’ve just been adding # type: ignore
to these lines, but obviously that’s not ideal at all.
Has anyone been able to get these stubs to work in this context? Or maybe I’m not supposed to be imported ‘Geometry’ and the like through Rhino.___?
thanks!!
@ed.p.may
Environment:
- Rhino-stubs v7.7.21140
- VSCode v1.89.1
- Pylance v2024.5.1
- MacOS Ventura 13.6.6