PEP 328: Imports: Multi-Line and Absolute/Relative

Gerrit gerrit at nl.linux.org
Wed Mar 10 12:41:08 CET 2004


Aahz wrote:
> * Long ``import`` statements can be difficult to write, requiring
>   various contortions to fit Pythonic style guidelines.

> Instead, it should be possible to use Python's standard grouping
> mechanism (parentheses) to write the ``import`` statement::
> 
>     from Tkinter import (Tk, Frame, Button, Entry, Canvas, Text
>         LEFT, DISABLED, NORMAL, RIDGE, END)
> 
> This part of the proposal already has BDFL approval.

Why are the parentheses necessary?
What's wrong with:

from Tkinter import Tk, Frame, Button,
    Entry, Canvas, Text,
    LEFT, DISABLED, NORMAL

...where Python's normal indentation mechanism provides the grouping?

Gerrit.

-- 
Weather in Twenthe, Netherlands 10/03 11:25 UTC:
	2.0°C light snow overcast wind 5.4 m/s NE (57 m above NAP)
-- 
Asperger's Syndrome - a personal approach:
	http://people.nl.linux.org/~gerrit/english/




More information about the Python-list mailing list