Hi @m_adam, thanks for taking time to answer my question. I have been using the dummy package before, but there are some limitations / shortcomings compared to the type checking functionality of mypy or pylance.
With the dummy package for example I am not getting the proper return type from BaseObject.GetName() which should be str but is None. Of course I can see that the return type is described as str in the docstring, but for the IDE it is still None and since it is a dummy package, the IDE can not infer the actual return type in python types or objects
When using my customized version of the dummy package I can get the correct return type
This is especially useful if I use something like GetChildren, because now pylance already knows about the type of objects in the returned list and I can easily browse the objects functions and can check in the IDE if my variables have the correct type
Would I be allowed to share my customized version of the dummy package? It is based on the provided package but with added type hints and modified imports where possible and covers ca. 90% of the definitions.
For example the definition for c4d.Vector would look like this:
class Vector(object):
x: float
y: float
z: float
def __init__(self, x: Optional[Union[int, Vector, float]] = ..., y: Optional[Union[int, float]] = ..., z: Optional[Union[int, float]] = ...) -> None:
"""
| Initializes a new :class:`Vector <c4d.Vector>`.
| All arguments are optional so it is possible to create a new vector without any arguments. All components are simply `0`.
| Otherwise *x* can be a :class:`Vector <c4d.Vector>` so all components of the passed vector will be copied to the new vector.
| If only a number is passed, all components will be set to this.
.. code-block:: python
c4d.Vector()
# => Vector(0,0,0)
c4d.Vector(100)
# => Vector(100,100,100)
v = c4d.Vector(100,100,100)
c4d.Vector(v)
# => Vector(100,100,100)
c4d.Vector(1,2,3)
# => Vector(1,2,3)
:type x: Union[int, float, c4d.Vector]
:param x: If *x* is a number and is the only passed argument, set this to all components. If *x* is a vector, clone it. Otherwise set the X component.
:type y: number
:param y: Set the Y component.
:type z: number
:param z: Set the Z component.
:rtype: c4d.Vector
:return: A new vector.
"""
...
Cheers