imports after function definitions?

Terry Reedy tjreedy at udel.edu
Fri Aug 29 00:02:06 EDT 2003


"Hallvard B Furuseth" <h.b.furuseth(nospam)@usit.uio(nospam).no> wrote
in message news:HBF.20030828usgy at bombur.uio.no...
> Is there any reason not to structure my program like this?
>
>    def ...
>    def ...
>    var = ...
>    var = ...
>    import ...
>    import ...
>    main_function()

It is helpful to human readers to see dependencies at the top and to
know what globals are avaiable when reading defs.  What would be
compensating gain of doing such?

Terry J. Reedy






More information about the Python-list mailing list