From 27fde79de691ecb81246f18ca877333d287456d6 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Thu, 9 Jul 2026 12:46:04 +0800 Subject: [PATCH] Update py_object.c --- src/bindings/py_object.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bindings/py_object.c b/src/bindings/py_object.c index 02b877a1..26dc21c8 100644 --- a/src/bindings/py_object.c +++ b/src/bindings/py_object.c @@ -36,10 +36,13 @@ static bool object__ne__(int argc, py_Ref argv) { static bool object__repr__(int argc, py_Ref argv) { PY_CHECK_ARGC(1); - assert(argv->is_ptr); c11_sbuf buf; c11_sbuf__ctor(&buf); - pk_sprintf(&buf, "<%t object at %p>", argv->type, argv->_obj); + if(argv->is_ptr) { + pk_sprintf(&buf, "<%t object at %p>", argv->type, argv->_obj); + } else { + pk_sprintf(&buf, "<%t trivial object>", argv->type); + } c11_sbuf__py_submit(&buf, py_retval()); return true; }