Python syntax wart

Duncan Booth duncan.booth at invalid.invalid
Sun Sep 9 06:06:59 EDT 2007


Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au> wrote:

> On Sun, 09 Sep 2007 17:16:05 +1200, Lawrence D'Oliveiro wrote:
> 
>> The one thing I don't like about Python syntax is using backslashes to
>> continue lines.
> 
> Then don't use them. Put everything in one long line.
> 
> Or do something like this. Instead of
> 
> for Link in GetEachRecord("lots", "and", "lots", "of", "arguments"):
> 
> you can do this:
> 
> args = ("lots", "and", "lots", "of", "arguments")
> for Link in GetEachRecord(*args):
> 

Or even just:

records = GetEachRecord("lots", "and", "lots", "of", "arguments")
for link in records:
   ...




More information about the Python-list mailing list