I'm preparing a package for PyPI submission with a similar (simplified) structure. Trying to balance memory footprint, execution time, and package design/dependencies.
Is there a Pythonic or some optimal placement (and why) of from math import exp
?
- at the top of main.py
- at the top of each sub-module (shared.py, a.py, b.py)
- at the top of each class
- at the top of each method that uses
exp()
- some other ways to import?
A gentle/constructive criticism of (or inquiries about) the structure is welcome :) References would be great!