default value for recursive

This commit is contained in:
Matthias 2021-10-09 20:57:30 +02:00
parent fa9168d660
commit 1dd41b0e2d
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -25,7 +25,7 @@ def iter_namespace(pkg):
return pkgutil.iter_modules(pkg.__path__, pkg.__name__ + ".")
def get_modules(pkg, recursive):
def get_modules(pkg, recursive: bool = False):
"""get all modules in a package"""
if not recursive:
return [importlib.import_module(name) for finder, name, ispkg in iter_namespace(pkg)]
@ -49,7 +49,7 @@ def get_classes(module):
return inspect.getmembers(module, inspect.isclass)
def get_plugins(pkg, baseclass, recursive):
def get_plugins(pkg, baseclass, recursive: bool = False):
"""
Return a list of all modules under a given package.