-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Thanks again for the awesome presentation today @drewoldag, this is a really neat template! One thing that I saw within the template is the use of a wildcard import with an example module as noted below. This is usually a really bad practice in Python as PEP8 states:
Wildcard imports (from import *) should be avoided, as they make it unclear which names are present in the namespace, confusing both readers and many automated tools. There is one defensible use case for a wildcard import, which is to republish an internal interface as part of a public API (for example, overwriting a pure Python implementation of an interface with the definitions from an optional accelerator module and exactly which definitions will be overwritten isn’t known in advance).
I think that it's would be better if the example could avoid this bad practice as it can potentially impact someone's learning of Python's best practice. Please let me know what you think, I can certainly make a PR on this. Thank you! 😄
python-project-template/python-project-template/src/{{module_name}}/__init__.py.jinja
Lines 1 to 3 in b7c0a9c
| {%- if create_example_module -%} | |
| from .example_module import * | |
| {% endif %} |