New submission from py.user <[email protected]>:
>>> with open('/etc/passwd') as f1, \
... open('/etc/profile) as f2:
File "<stdin>", line 2
open('/etc/profile) as f2:
^
SyntaxError: EOL while scanning string literal
>>>
>>> with open('/etc/passwd') as f1, open('/etc/profile') as f2:
...
working example for a loop:
>>> for i, j in zip(range(10), \
... range(5, 15)):
... print(i, j)
...
0 5
1 6
2 7
3 8
4 9
5 10
6 11
7 12
8 13
9 14
>>>
>>> for i, j in \
... zip(range(10), range(5, 15)):
... print(i, j)
...
0 5
1 6
2 7
3 8
4 9
5 10
6 11
7 12
8 13
9 14
>>>
----------
components: Interpreter Core
messages: 141596
nosy: py.user
priority: normal
severity: normal
status: open
title: The backslash escape doesn't concatenate two strings in one in the with
statement
type: behavior
versions: Python 3.1
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue12685>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com