| Store | Cart

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

From: John Roth <news...@jhrothjr.com>
Wed, 10 Mar 2004 08:13:46 -0500
"Gerrit" <gerrit at nl.linux.org> wrote in message
news:mailman.217.1078918903.19534.python-list at python.org...
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?


[response]
Because it's a deviation from the syntax elsewhere in Python.
It's not clear that the trailing comma means the statement is
to be continued. I'm not sure whether the trailing comma is
valid or whether it causes an error, but in neither case is it
regarded as an indication that the statment is to be continued.

It might be interesting to do it that way, but if so it should be
accepted as a continuation indicator in all contexts.

John Roth
[/response]


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/

Recent Messages in this Thread
Aahz Mar 08, 2004 08:24 pm
John Roth Mar 09, 2004 01:04 am
Aahz Mar 10, 2004 10:49 am
John Roth Mar 10, 2004 01:04 pm
Stephen Horne Mar 10, 2004 04:44 pm
John Roth Mar 10, 2004 06:14 pm
Stephen Horne Mar 09, 2004 01:09 am
Mike Mar 09, 2004 03:39 am
Josiah Carlson Mar 09, 2004 06:34 am
Sean Ross Mar 09, 2004 06:13 pm
Paul Rubin Mar 09, 2004 10:44 pm
Josiah Carlson Mar 10, 2004 04:20 am
Andrew Clover Mar 10, 2004 01:18 pm
Sean Ross Mar 10, 2004 03:11 pm
Josiah Carlson Mar 12, 2004 07:06 am
Thomas Heller Mar 09, 2004 07:41 am
Andrew Clover Mar 09, 2004 10:12 am
Denis S. Otkidach Mar 09, 2004 10:50 am
Gerrit Mar 10, 2004 11:41 am
Anders J. Munch Mar 10, 2004 02:46 pm
Dieter Maurer Mar 11, 2004 10:29 pm
Geoff Howland Mar 14, 2004 12:50 am
Andrew Clover Mar 15, 2004 09:52 am
Bernhard Herzog Mar 15, 2004 11:26 am
Aahz Mar 10, 2004 11:01 am
John Roth Mar 10, 2004 01:13 pm
Messages in this thread