Skip to content

Comment on Ask YC: Best practice for Python module imports?

Comments

Ok I appreciate the helpful discussion, this will inform my future practice. To wrap up, I think the takeaways are:

a, use your head, don't let convention override reason b, In general, keep module imports at the top of the file organized by type & package with the caveat that a large # of imports (say more than 10 or 20) may indicate the module is too ambitious and is a candidate for refactoring.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.