Skip to content

Commit

Permalink
Merge branch 'master' of github.com:radon-project/radon into mypy-str…
Browse files Browse the repository at this point in the history
…ict-fixing
  • Loading branch information
Almas-Ali committed Jul 24, 2024
2 parents a3622c8 + b69126f commit 67c9b77
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
![GitHub Workflow Status](https://github.com/radon-project/radon/actions/workflows/ci.yaml/badge.svg "GitHub Workflow Status")
![GitHub license](https://img.shields.io/github/license/radon-project/radon?style=flat "License")
![Total hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fradon-project%2Fradon&count_bg=%2352B308&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false "Total hits")
[![Discord](https://img.shields.io/discord/1137834560290308306?style=flat&logo=discord&logoColor=%235865F2&label=join&link=https%3A%2F%2Fdiscord.gg%2Fy2x4CSX7DM "Discord")](https://discord.gg/y2x4CSX7DM)
[![Discord](https://img.shields.io/discord/1137834560290308306?style=flat&logo=discord&logoColor=%235865F2&label=join&link=https%3A%2F%2Fdiscord.gg%2FnNkQKfcxqa "Discord")](https://discord.com/invite/nNkQKfcxqa)

</div>

Expand Down
16 changes: 16 additions & 0 deletions core/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1470,6 +1470,22 @@ class Module(Value):
file_path: str
symbol_table: SymbolTable

def __help_repr__(self) -> str:
result: str = f"Help on object {self.name}:\n\nmodule {self.name}\n|\n"
for k in self.symbol_table.symbols:
f = self.symbol_table.symbols[k]

if (type(f).__name__ == "BuiltInClass") or (type(f).__name__ == "BuiltInFunction"):
continue
if k == "null" or k == "false" or k == "true":
continue

if isinstance(f, Function):
result += f.__help_repr_method__()
elif isinstance(f, Value):
result += f"| {k} = {f!r}\n|\n"
return result

def __init__(self, name: str, file_path: str, symbol_table: SymbolTable) -> None:
super().__init__()
self.name = name
Expand Down

0 comments on commit 67c9b77

Please sign in to comment.