Skip to content

Commit 14952a9

Browse files
committed
Add function that returns a list of all functions in their respective category
1 parent 830db4a commit 14952a9

File tree

5 files changed

+44
-0
lines changed

5 files changed

+44
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . modules import modules
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import pkgutil
2+
def modules():
3+
"""
4+
Find all functions in pygorithm.data_structures
5+
"""
6+
import pygorithm.data_structures
7+
package = pygorithm.data_structures
8+
modules = []
9+
for importer, modname, ispkg in pkgutil.iter_modules(package.__path__):
10+
modules.append(modname)
11+
modules.remove('modules')
12+
modules.sort()
13+
return modules
14+

pygorithm/searching/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . modules import modules

pygorithm/searching/modules.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import pkgutil
2+
def modules():
3+
"""
4+
Find all functions in pygorithm.searching
5+
"""
6+
import pygorithm.searching
7+
package = pygorithm.searching
8+
modules = []
9+
for importer, modname, ispkg in pkgutil.iter_modules(package.__path__):
10+
modules.append(modname)
11+
modules.remove('modules')
12+
modules.sort()
13+
return modules
14+

pygorithm/sorting/modules.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import pkgutil
2+
def modules():
3+
"""
4+
Find all functions in pygorithm.sorting
5+
"""
6+
import pygorithm.sorting
7+
package = pygorithm.sorting
8+
modules = []
9+
for importer, modname, ispkg in pkgutil.iter_modules(package.__path__):
10+
modules.append(modname)
11+
modules.remove('modules')
12+
modules.sort()
13+
return modules
14+

0 commit comments

Comments
 (0)