* Mats Wichmann <m...@wichmann.us> [2017-07-05 16:47]: > > > > As a vaguely contradictory position to a part of this (which I in the > main agree with): if your objective is to make a module, and also have > some code (perhaps including test code) which is run in the non-module > (aka not-imported) case, then stuffing that code in a function main() > means you've exposed that not-really-module-code as part of the module, > and might then want to take steps to hide it from clients so it doesn't > end up looking like part of the module API.
In most cases, my scripts tend to be pretty self-contained and written for my own purposes, so that would rarely be an issue. How would you hide main() if you _were_ concerned about it? -- David Rock da...@graniteweb.com
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor