Skip to content

Commit 80d1c07

Browse files
Add pretty printing for round
1 parent 32acaba commit 80d1c07

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

python/egglog/pretty.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ def _call_inner( # noqa: C901, PLR0911, PLR0912
394394
return f"{tp_ref}.{method_name}", args
395395
case MethodRef(_class_name, method_name):
396396
slf, *args = args
397+
non_str_slf = slf
397398
slf = self(slf, parens=True)
398399
match method_name:
399400
case _ if method_name in UNARY_METHODS:
@@ -410,6 +411,8 @@ def _call_inner( # noqa: C901, PLR0911, PLR0912
410411
return f"del {slf}[{self(args[0], unwrap_lit=True)}]"
411412
case "__setitem__":
412413
return f"{slf}[{self(args[0], unwrap_lit=True)}] = {self(args[1], unwrap_lit=True)}"
414+
case "__round__":
415+
return "round", [non_str_slf, *args]
413416
case _:
414417
return f"{slf}.{method_name}", args
415418
case ConstantRef(name):

0 commit comments

Comments
 (0)