PEP new assert idiom

Fábio Mendes niels_bohr at uol.com.br
Sun Nov 7 15:03:37 EST 2004


Em Dom, 2004-11-07 às 08:56 +0000, Steven Bethard escreveu:
> Fábio Mendes <niels_bohr <at> uol.com.br> writes:
> > 
> > I never said that commas should mean line continuation (as a backslash).
> > It CAN be used as implicit line continuations in lot cases, (like
> > function arguments, for instance. This would be just one more case.
> 
> I'm not sure that I understand you correctly, but if you're saying that the
> commas in a function argument list indicate an implicit line continuation, I
> think this is probably not correct.  It's the unclosed parentheses that indicate
> the line continuation, not the commas -- this is why you can write a function
> argument list across multiple lines, but it's also why you can write a tuple
> across lines:
> 
> >>> def f(x,
> ... y, z):
> ... 	print x, y, z
> ... 	

Now it makes sense to me... i thought that the commas was responsable for line continuation because this is how we usually separate the functions arguments and list/tuple/dictionary items. I never thought that this would work:

>>> d = {'foo':
...      'bar',
...      'bar':
...      'foo' }
 
But it works indeed ;)

I think my PEP is getting more and more nonsensical... I give up! Thanks for your advice guys,
Fabio




More information about the Python-list mailing list