3 ms·
utils.py is better than the alternative of every module reimplementing some common utility, or importing an otherwise unneeded module because that's where said
by andreareina 3y ago
utils.py is better than the alternative of every module reimplementing some common utility, or importing an otherwise unneeded module because that's where said common utility was first implemented. The fact that there's util.py in the first place is a good thing. Now, if it gets big and disparate enough then having foo_utils.py and bar_utils.py might be even better (but maybe they should be in their own subpackages instead, i.e. foo/utils.py and bar/utils.py?), but that doesn't make utils.py bad.