Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue7391] Re-title the "Using Backslash to Continue Statements" anti-idiom

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Nov 24, 2009, 6:19 AM

Post #1 of 4 (273 views)
Permalink
[issue7391] Re-title the "Using Backslash to Continue Statements" anti-idiom

New submission from Neil Cerutti <cerutti [at] trans-video>:

This "anti-idiom" is in the Python HOWTOs->Idioms and Anti-Idioms

The current title is "Using Backslash to Continue Statements"

However, using the line continuation character won't cause mysterious
problems in statements, but only in certain expressions, as the article
goes on to explain.

Moreover, the proposed solution of wrapping expressions in parentheses
is a syntax error in a statement, e.g.:

with (open(roster_path, 'r') as roster_file,
open(disb_path, 'w') as out_file,
open(report_path, 'w') as report_file):
File "C:\project\codxml.py", line 184
with (open(roster_path, 'r') as roster_file,
^
SyntaxError: invalid syntax

I suggest that the title be changed to "Using Backslash to Continue
Expressions."

I'm sorry I don't know for sure when this HOWTO was first included in
the normal Python distribution.

----------
assignee: georg.brandl
components: Documentation
messages: 95676
nosy: Horpner, georg.brandl
severity: normal
status: open
title: Re-title the "Using Backslash to Continue Statements" anti-idiom
versions: Python 3.0, Python 3.1, Python 3.2

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7391>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 24, 2009, 2:45 PM

Post #2 of 4 (248 views)
Permalink
[issue7391] Re-title the "Using Backslash to Continue Statements" anti-idiom [In reply to]

Georg Brandl <georg [at] python> added the comment:

As you write, the parentheses "trick" only works in expressions (what
you tried to wrap in your with statement is not an expression).

The backslash works for all kinds of statements however, so the
suggested change is wrong.

----------
resolution: -> wont fix
status: open -> pending

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7391>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 25, 2009, 9:01 AM

Post #3 of 4 (248 views)
Permalink
[issue7391] Re-title the "Using Backslash to Continue Statements" anti-idiom [In reply to]

Neil Cerutti <cerutti [at] trans-video> added the comment:

Yes, I know. That's why I feel it should not be labeled an anti-idiom,
as it currently seems to be.

----------
status: pending -> open

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7391>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 25, 2009, 9:13 AM

Post #4 of 4 (242 views)
Permalink
[issue7391] Re-title the "Using Backslash to Continue Statements" anti-idiom [In reply to]

Georg Brandl <georg [at] python> added the comment:

Agreed.

----------
priority: -> low
resolution: wont fix ->

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7391>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.