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 cryvate
Recipients benjamin.peterson, brett.cannon, cryvate, ncoghlan, serhiy.storchaka, yselivanov
Date 2017-11-13.15:19:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
[As a follow-on, should I open a new issue/discuss on python-dev? Willing to help out with a solution on way or another! I know, "In my head" <> "Should be the case" etc. very much applies.]

In my head

    def foo(): pass

is equivalent to

    def _foo(): pass
    foo = ...()
    del _foo

However the following shows this is not the case:

    def foo(): pass

throws a syntax error, whereas

    def _foo(): pass
    foo = 0(_foo)

throws a type error. This might seem silly, but it is still unexpected. has

    decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE

which in my head is

    decorator ::= "@" atom NEWLINE

Similarly for classes:

    inheritance ::= "(" [argument_list] ")"

which allows for keyword arguments (does that make any sense!?). In my head it is (compare with call:

    inheritance ::= "(" [positional_arguments [","] | comprehension] ")"

[Tangentially related, this is how I originally got onto the mailing lists, my unhappiness with the definition of the for statement (

    for_stmt ::= "for" target_list "in" expression_list ":" suite ["else" ":" suite]

Which I would expect to be:

    for_stmt ::= comp_for ":" suite ["else" ":" suite]

so you could e.g. have if statements.
Date User Action Args
2017-11-13 15:19:50cryvatesetrecipients: + cryvate, brett.cannon, ncoghlan, benjamin.peterson, serhiy.storchaka, yselivanov
2017-11-13 15:19:50cryvatesetmessageid: <>
2017-11-13 15:19:50cryvatelinkissue32012 messages
2017-11-13 15:19:49cryvatecreate