mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
ifcopenshell_wrapper.pyi - sync default values, validate_stub - suggest default values
This commit is contained in:
@@ -61,7 +61,14 @@ def get_function_node_name(node: ast.FunctionDef) -> Union[SubnameType, None]:
|
||||
|
||||
if node_name.startswith("_") and node_name not in ("_is",) and not is_init:
|
||||
return None
|
||||
args = [a.arg for a in node.args.args]
|
||||
arg_nodes = node.args.args
|
||||
defaults = [None] * (len(arg_nodes) - len(node.args.defaults)) + node.args.defaults
|
||||
args: list[str] = []
|
||||
for arg, default in zip(arg_nodes, defaults):
|
||||
if default is None:
|
||||
args.append(arg.arg)
|
||||
else:
|
||||
args.append(f"{arg.arg}={ast.unparse(default)}")
|
||||
|
||||
# Skip non-informative constructors.
|
||||
if is_init and args == ["self"]:
|
||||
|
||||
Reference in New Issue
Block a user