Issue6978
Created on 2009-09-23 13:35 by kees, last changed 2009-10-22 01:47 by benjamin.peterson.
|
msg93034 - (view) |
Author: Kees Bos (kees) |
Date: 2009-09-23 13:35 |
|
compiler.parse("d[1] = 1") should have a single tuple as subs
>>> compiler.parse("d[1] = 1")
Module(None, Stmt([Assign([Subscript(Name('d'), 'OP_ASSIGN',
[Const(1)])], Const(1))]))
>>> compiler.parse("d[1,] = 2")
Module(None, Stmt([Assign([Subscript(Name('d'), 'OP_ASSIGN',
[Const(1)])], Const(2))]))
>>> compiler.parse("d[1,2] = 3")
Module(None, Stmt([Assign([Subscript(Name('d'), 'OP_ASSIGN', [Const(1),
Const(2)])], Const(3))]))
>>> compiler.parse("d[(1,)] = 2")
Module(None, Stmt([Assign([Subscript(Name('d'), 'OP_ASSIGN',
[Tuple([Const(1)])])], Const(2))]))
|
|
msg93036 - (view) |
Author: Kees Bos (kees) |
Date: 2009-09-23 14:11 |
|
I just see that my patch is not correct, since the following is
supported by the language:
O[1:2:3, 4:5:6]
Where O[1:2:3, 4:5:6] == O[slice(1,2,3), slice(4,5,6)] ==
O.__getitem__((slice(1,2,3), slice(4,5,6)))
|
|
msg93037 - (view) |
Author: Kees Bos (kees) |
Date: 2009-09-23 14:24 |
|
patch which honors O[1:2:3, 4:5:6]
|
|
msg93690 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) |
Date: 2009-10-07 11:55 |
|
your patch is no more a diff file (the 'previous' file is empty)
|
|
msg93693 - (view) |
Author: Kees Bos (kees) |
Date: 2009-10-07 12:30 |
|
Sorry. Renamed .bak to .orig ...
Here's the patch compiler/transformer.py (against python 2.5)
|
|
msg94320 - (view) |
Author: Chuck Rhode (ChuckRhode) |
Date: 2009-10-21 19:48 |
|
PythonTidy encounters this problem.
o http://lacusveris.com/PythonTidy/PythonTidy.python
It is unable correctly to render line 694 of test_grammar.py in the
Python Test Suite:
d[1,] = 2
becomes:
d[1] = 2
because the *compiler* module does not return an abstract syntax tree
containing a tuple for the subscript.
|
|
msg94332 - (view) |
Author: Benjamin Peterson (benjamin.peterson) |
Date: 2009-10-22 01:47 |
|
The patch should have a test.
|
|
| Date |
User |
Action |
Args |
| 2009-10-22 01:47:10 | benjamin.peterson | set | nosy:
+ benjamin.peterson messages:
+ msg94332
|
| 2009-10-21 19:48:19 | ChuckRhode | set | nosy:
+ ChuckRhode messages:
+ msg94320
|
| 2009-10-07 12:30:53 | kees | set | files:
+ transformer.py.patch
messages:
+ msg93693 |
| 2009-10-07 11:55:33 | amaury.forgeotdarc | set | nosy:
+ amaury.forgeotdarc messages:
+ msg93690
|
| 2009-09-23 14:24:54 | kees | set | files:
- compiler.transformer.patch |
| 2009-09-23 14:24:23 | kees | set | files:
+ compiler.transformer.patch
messages:
+ msg93037 |
| 2009-09-23 14:11:26 | kees | set | messages:
+ msg93036 |
| 2009-09-23 13:35:34 | kees | create | |
|