Idioms and Anti-Idioms Question

Carl Banks pavlovevidence at gmail.com
Tue Jun 23 17:32:43 CEST 2009


On Jun 21, 9:14 pm, Ben Charrow <bchar... at csail.mit.edu> wrote:
> I have a question about the "Using Backslash to Continue Statements" in the
> howto "Idioms and Anti-Idioms in Python"
> (http://docs.python.org/howto/doanddont.html#using-backslash-to-contin...)
>
> It says:
>
> "...if the code was:
>
> value = foo.bar()['first'][0]*baz.quux(1, 2)[5:9] \
>          + calculate_number(10, 20)*forbulate(500, 360)
>
> then it would just be subtly wrong."
>
> What is subtly wrong about this piece of code?  I can't see any bugs and can't
> think of subtle gotchas (e.g. the '\' is removed or the lines become separated,
> because in both cases an IndentationError would be raised).

Perhaps it was originally was like this:

value = foo.bar()['first'][0]*baz.quux(1, 2)[5:9] \
+ calculate_number(10, 20)*forbulate(500, 360)


Carl Banks



More information about the Python-list mailing list