On 12/12/05, Ian Bicking <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > This is subjective enough that I would think some rationale explaining this > > convention should be given. Personally, I group imports into three sections > > as follows: > > > > * Python core modules/packages > > > > * Third-party modules/packages > > > > * Local modules/packages > > This is already in PEP 8: > > - Imports are always put at the top of the file, just after any > module comments and docstrings, and before module globals and > constants. Imports should be grouped, with the order being > > 1. standard library imports > 2. related major package imports (i.e. all email package imports next) > 3. application specific imports
Hm. I like Skip's list better; "related major package imports" is a bit vague and ambiguous. It seems to have been written before email became a standard library module; also it clearly meant to say "e.g." instead of "i.e.". > You should put a blank line between each group of imports. > > I would suggest that it should also say that __all__ goes after imports. +1 -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com