[issue36637] Restrict syntax for tuple literals with one element

2019-04-15 Thread Brett Cannon
Brett Cannon added the comment: Thanks for the idea, but this would break way too much code to warrant changing it. Plus making this act differently just in the single-item case is too much special-casing/surprise. -- resolution: -> rejected stage: -> resolved status: open -> close

[issue36637] Restrict syntax for tuple literals with one element

2019-04-15 Thread danijar
New submission from danijar : A tuple can be created with or without parentheses: a = (1, 2, 3) a = 1, 2, 3 While both are intuitive in this example, omitting the parentheses can lead to hard to find errors when there is only one element: a = (1,) a = 1, The first is clear but the second