➜

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.

作者 serhiy.storchaka
收信人 benjamin.peterson, cheryl.sabella, jayvdb, jstasiak, serhiy.storchaka
日期 2017-09-26.18:11:47
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1506449507.12.0.509429004846.issue27494@psf.upfronthosting.co.za>
In-reply-to
内容
set(x for x in range(2),) can be interpreted as set(x for x in (range(2),)).

Wouldn't be better to forbid such ambiguous syntax? The trailing comma in argument list is supported because it helps to add new arguments (or temporary comment out arguments).

    foo(x,
        y,
        #z,
       )

But set(x for x in range(2),) is not syntactically valid if add an argument after the comma. Parenthesis around a generator expression can be omitted only if it is the only argument in a function call. I think that it would be better to forbid a trailing comma in this case.
历史
日期 用户 动作 参数
2017-09-26 18:11:47serhiy.storchaka修改recipients: + serhiy.storchaka, benjamin.peterson, jstasiak, jayvdb, cheryl.sabella
2017-09-26 18:11:47serhiy.storchaka修改messageid: <1506449507.12.0.509429004846.issue27494@psf.upfronthosting.co.za>
2017-09-26 18:11:47serhiy.storchaka链接issue27494 messages
2017-09-26 18:11:47serhiy.storchaka创建