[New-bugs-announce] [issue32024] Nominal decorator function call syntax is inconsistent with regular function calls

Nick Coghlan report at bugs.python.org
Tue Nov 14 08:09:52 EST 2017


New submission from Nick Coghlan <ncoghlan at gmail.com>:

Function calls in decorators are implemented as regular function calls, and hence permit the use of generator expressions as their sole argument without a second pair of parentheses.

However, https://docs.python.org/3/reference/compound_stmts.html#function-definitions defines the permitted arguments differently from the way https://docs.python.org/3/reference/expressions.html#calls defines them, and thus technically considers a "function call as a decorator" to be a different construct from "a function call".

The actual implementation treats these as the same thing, so clarification is needed as to whether it is the implementation or the language specification that should be updated to resolve the inconsistency.

----------
assignee: docs at python
components: Documentation
messages: 306205
nosy: docs at python, gvanrossum, ncoghlan, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Nominal decorator function call syntax is inconsistent with regular function calls
type: behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32024>
_______________________________________


More information about the New-bugs-announce mailing list