Skip to content

Commit 996a53c

Browse files
committed
Added fibonacci/modules.py for getting all the available modules
1 parent c522beb commit 996a53c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

pygorithm/fibonacci/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
from pygorithm.fibonacci import cache
22
from pygorithm.fibonacci import recursion
3+
from . modules import modules

pygorithm/fibonacci/modules.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import pkgutil
2+
def modules():
3+
"""
4+
Find all functions in pygorithm.data_structures
5+
"""
6+
import pygorithm.fibonacci
7+
package = pygorithm.fibonacci
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

0 commit comments

Comments
 (0)