Skip to content

Commit

Permalink
Python: use self as default _root only in top-level types
Browse files Browse the repository at this point in the history
  • Loading branch information
generalmimon committed Apr 14, 2024
1 parent 91a1074 commit c027d13
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ class PythonCompiler(typeProvider: ClassTypeProvider, config: RuntimeConfig)
out.inc
out.puts("self._io = _io")
out.puts("self._parent = _parent")
out.puts("self._root = _root if _root else self")
if (name == rootClassName) {
out.puts("self._root = _root if _root else self")
} else {
out.puts("self._root = _root")
}

if (isHybrid)
out.puts("self._is_le = _is_le")
Expand Down

0 comments on commit c027d13

Please sign in to comment.