Skip to content

Commit

Permalink
fix: ruff formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Vardan2009 committed May 29, 2024
1 parent 43f6279 commit a9e1a32
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions core/builtin_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ def execute_len(self, exec_ctx: Context) -> RTResult[Value]:
def execute_input(self, exec_ctx: Context) -> RTResult[Value]:
text = input(str(exec_ctx.symbol_table.get("value")))
return RTResult[Value]().success(String(text))

@args(["obj"])
def execute_help(self, exec_ctx: Context) -> RTResult[Value]:
obj = exec_ctx.symbol_table.get("obj")
if obj is None:
return RTResult[Value]().failure(Error(self.pos_start, self.pos_end, "TypeError", 'Argument is null'))
return RTResult[Value]().failure(Error(self.pos_start, self.pos_end, "TypeError", "Argument is null"))
print(obj.__help_repr__())
return RTResult[Value]().success(obj)

Expand Down
12 changes: 6 additions & 6 deletions core/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def copy(self: Self) -> Self:

def is_true(self) -> bool:
return False

# Help text for help() in radon
def __help_repr__(self) -> str:
return """
Expand Down Expand Up @@ -292,7 +292,7 @@ def is_true(self) -> bool:

def __str__(self) -> str:
return str(self.value)

def __help_repr__(self) -> str:
return """
Number
Expand Down Expand Up @@ -374,7 +374,7 @@ def __str__(self) -> str:

def __repr__(self) -> str:
return "true" if self.value else "false"

def __help_repr__(self) -> str:
return """
Boolean
Expand Down Expand Up @@ -522,7 +522,7 @@ def __str__(self) -> str:

def __repr__(self) -> str:
return f'"{self.value}"'

def __help_repr__(self) -> str:
return """
String
Expand Down Expand Up @@ -714,7 +714,7 @@ def __str__(self) -> str:

def __repr__(self) -> str:
return f'[{", ".join(repr(x) for x in self.elements)}]'

def __help_repr__(self) -> str:
return """
Array
Expand Down Expand Up @@ -853,7 +853,7 @@ def copy(self) -> HashMap:

def __str__(self) -> str:
return self.__repr__()

def __help_repr__(self) -> str:
return """
HashMap
Expand Down

0 comments on commit a9e1a32

Please sign in to comment.