Skip to content

Commit e3ce682

Browse files
gramalingamCopilot
andcommitted
Make GraphBuilder.__init__ use keyword-only args after graph
Add '*' separator so that 'parent' (and future parameters like 'options') must be passed as keyword arguments, improving API stability and readability. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c6e8ec6 commit e3ce682

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

onnxscript/_internal/builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def build_function(
421421
class GraphBuilder:
422422
"""Imperative builder for constructing ONNX IR graphs with automatic constant promotion, type casting, and shape inference."""
423423

424-
def __init__(self, graph: ir.Graph, parent: GraphBuilder | None = None) -> None:
424+
def __init__(self, graph: ir.Graph, *, parent: GraphBuilder | None = None) -> None:
425425
self._graph = graph
426426
self._parent = parent
427427
self._root: GraphBuilder = parent._root if parent is not None else self

0 commit comments

Comments
 (0)