Skip to content

Commit 0ca5ef8

Browse files
committed
Added __init__ and modules.py
1 parent 3def30b commit 0ca5ef8

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

pygorithm/string/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""
2+
Collection of string methods and functions
3+
"""
4+
from . import anagram
5+
from . import pangram
6+
from . import isogram
7+
from . import modules
8+
from . import palindrome
9+
10+
__all__ = [
11+
'anagram',
12+
'pangram',
13+
'isogram',
14+
'palindrome'
15+
]

pygorithm/string/modules.py

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

0 commit comments

Comments
 (0)