Skip to content

Commit 8ce157e

Browse files
Added classes info
1 parent 655925d commit 8ce157e

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

py_module_info/_core.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def get_func_meta_data(func: ast.FunctionDef, code: str, only_func_names: bool =
5252
return meta_data
5353

5454

55-
def get_class_bases(_class: ast.ClassDef, code: str):
55+
def get_class_bases(_class: ast.ClassDef, code: str) -> List[str]:
5656
"""Returns the names of all the inherited classes in a class"""
5757
bases = []
5858
for b in _class.bases:
@@ -63,7 +63,11 @@ def get_class_bases(_class: ast.ClassDef, code: str):
6363
return bases
6464

6565

66-
def get_class_meta_data(_class: ast.ClassDef, code: str):
66+
ClassInfoReturnType = Dict[str,
67+
Union[List[str], Dict[str, Union[int, List[str]]]]]
68+
69+
70+
def get_class_meta_data(_class: ast.ClassDef, code: str) -> ClassInfoReturnType:
6771

6872
meta_data = {}
6973
if isinstance(_class, ast.ClassDef):

py_module_info/main.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,7 @@ def get_imports(self) -> Imports:
105105
return Imports(get_imports(self._tree))
106106

107107
def get_funcs_info(self, only_func_names: bool = False) -> Dict[str, List[ast.Call]]:
108-
"""Return a list of all the func call that are executed inside the funcs
109-
Example:
110-
def foo():
111-
with open("test.json", "r") as f:
112-
load(f)
113-
the function when called for get_func_call_in_func will return ast.Call object of open, load
108+
"""R
114109
"""
115110

116111
func_info = {}

0 commit comments

Comments
 (0)