This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kayhayen
Recipients kayhayen
Date 2010-08-21.16:32:18
SpamBayes Score 2.4531514e-07
Marked as misclassified No
Message-id <1282408347.11.0.146975597015.issue9656@psf.upfronthosting.co.za>
In-reply-to
Content
Please check the following:

[GCC 4.4.5 20100728 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import compiler
>>> compiler.parse( "d[1,] = None" )
Module(None, Stmt([Assign([Subscript(Name('d'), 'OP_ASSIGN', [Const(1)])], Name('None'))]))
>>> compiler.parse( "d[1] = None" )
Module(None, Stmt([Assign([Subscript(Name('d'), 'OP_ASSIGN', [Const(1)])], Name('None'))]))
>>> d = {}
>>> d[1,] = None
>>> d[1] = None
>>> d
{1: None, (1,): None}

As you can see d[1] = None and d[1,] = None do different things, but do they lead to the same abstract syntax tree. It's the same on Python 2.7:

Python 2.7.0+ (r27:82500, Aug  7 2010, 19:41:51) 
[GCC 4.4.5 20100728 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import compiler
>>> compiler.parse( "d[1,] = None" )
Module(None, Stmt([Assign([Subscript(Name('d'), 'OP_ASSIGN', [Const(1)])], Name('None'))]))
>>> compiler.parse( "d[1] = None" )
Module(None, Stmt([Assign([Subscript(Name('d'), 'OP_ASSIGN', [Const(1)])], Name('None'))]))
History
Date User Action Args
2010-08-21 16:32:27kayhayensetrecipients: + kayhayen
2010-08-21 16:32:27kayhayensetmessageid: <1282408347.11.0.146975597015.issue9656@psf.upfronthosting.co.za>
2010-08-21 16:32:19kayhayenlinkissue9656 messages
2010-08-21 16:32:18kayhayencreate