From 0f142dddccf5936da3bd3014f96f991c6554e126 Mon Sep 17 00:00:00 2001 From: Vardan Petrosyan Date: Wed, 29 May 2024 21:30:44 +0400 Subject: [PATCH] fix: __help_repr__ function --- core/datatypes.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/core/datatypes.py b/core/datatypes.py index 7b69253..1ce637b 100755 --- a/core/datatypes.py +++ b/core/datatypes.py @@ -1204,6 +1204,10 @@ def __exec_len__(self): except AttributeError: return Null.null() + def __help_repr__(self) -> str: + result = str(self.operator("__help_repr__")[0]) + return result + def bind_method(self, method: BaseFunction) -> RTResult[BaseFunction]: method = method.copy() if method.symbol_table is None: @@ -1231,12 +1235,6 @@ def __repr__(self) -> str: # TODO: make this overloadable as well return f"" - def __help_repr__(self) -> str: - try: - return self.operator("__help_repr__")[0].value - except AttributeError: - return f"No custom help for class `{self.parent_class.name}`" - class BaseClass(Value, ABC): name: str