On Thu, Jul 5, 2018 at 9:20 PM, Marko Rauhamaa <ma...@pacujo.net> wrote:
> Rhodri James <rho...@kynesim.co.uk>:
>> I'm not a big fan of "main()" functions myself; creating a function
>> which will be called exactly once seems rather wasteful.
>
> A function is the encapsulation of a distinct ... well ... function.
> Functions that are called just once are desirable.
>
> So I'm saying the opposite:
>
>  * Have no code outside functions.

So, no import statements outside functions, no "if name is main"
incantation, and especially, no function definitions outside
functions, because they are themselves code.

What code is permitted outside functions and what isn't?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to