-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
At the moment, the stubs are generated by inspecting hou by itself, then patching in missing classes, functions, etc with hou_cleanup_config.py.
This leaves open a lot of room for error/missing parts, as well as being extremely fragile for functions that have an argument added, removed, or changed.
The source of truth should be the houpythonportion package, which provides the additional class and function definitions.
Unfortunately, this is complicated to use for the folllowing reasons:
- functions are added via a monkeypatching operation, which means we cannot just
from houpythonportion.data import dataintohou:
def _addMethod(cls):
"""This decorator converts the function into an unbound method and adds
it to the specified class.
"""
import types
def decorator(func):
# Python 3 got rid of the concept of an unbound method.
# A function in a class is now just a function.
unbound_method = func
setattr(cls, func.__name__, unbound_method)
return unbound_method
return decorator- The argspecs for some functions are changed when they are added, stripping off
selfin some cases. - AFAIK none of the functions in
houpythonportionhave any typing information or documentation, making automatic stub generation for these functions very difficult.
Metadata
Metadata
Assignees
Labels
No labels