Message265735
https://docs.python.org/3.2/reference/compound_stmts.html#function-definitions
and onwards say the following
decorator ::= "@" dotted_name ["(" [parameter_list [","]] ")"] NEWLINE
This is a regression from the 2.7 docs, which correctly said
decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE
The implication is that the following is supposedly valid in python 3:
@deco(what : "is this" = "supposed to mean")
def foo(annotations: "are only for here" = "right?"):
pass
The interpreter disagrees with the docs, and correctly rejects this syntax as garbage |
|
Date |
User |
Action |
Args |
2016-05-16 22:12:05 | Eric.Wieser | set | recipients:
+ Eric.Wieser, docs@python |
2016-05-16 22:12:05 | Eric.Wieser | set | messageid: <1463436725.68.0.177476383596.issue27042@psf.upfronthosting.co.za> |
2016-05-16 22:12:05 | Eric.Wieser | link | issue27042 messages |
2016-05-16 22:12:05 | Eric.Wieser | create | |
|