New submission from rurpy the second <ru...@yahoo.com>: The Python HOWTOs->Idioms and Anti-Idioms has a section "Using Backslash to Continue Statements".
It says that line continuation is "dangerous" and gives two reasons. 1. Hard to see a space after the backslash. This is not "dangerous" as it cause an impossible-to-miss syntax error (as pointed out in the following sentence.) 2. It can cause other "subtle" errors. It gives a code example purporting to demonstrate this but without saying what the input data to the code is or what the resulting problem is. I spent a while trying to figure it out unsuccessfully. In http://www.mail-archive.com/python-l...@python.org/msg249344.html a number of c.l.p regulars did not figure it out either. I also note related bug http://bugs.python.org/issue7391 that points out that avoinding backslashed continuations with parens is not always possible. So I suggest... 1. If the the given example actually illustrates a real problem, document clearly what it is. This is a reference manual, not a quiz book. 2. If not, then remove that argument. Now the only reason for not using backslashes is that a hard-to-see space after the backslash will cause a syntax error. That is neither dangerous or a strong reason not to do it. An unstated reason is that PEP-8 recommends against it but its recommendation is not absolute and is based only on aethtetics. With no real arguments against using it other than style, it should not be documented as an anti-idiom, recommendations against it should remain only in PEP-8 with other such style guidelines, and this section should be removed from the Anti-Idioms chapter. ---------- assignee: d...@python components: Documentation messages: 122477 nosy: d...@python, rurpy2 priority: normal severity: normal status: open title: remove or rewrite "Using Backslash to Continue Statements" anti-idiom _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10545> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com