[Python-Dev] Decorator syntax
MRAB
python at mrabarnett.plus.com
Wed Sep 2 18:36:54 CEST 2009
James Y Knight wrote:
> On Sep 2, 2009, at 6:15 AM, Rob Cliffe wrote:
>
>> So - the syntax restriction seems not only inconsistent, but
>> pointless; it doesn't forbid anything, but merely means we have to do
>> it in a slightly convoluted (unPythonesque) way. So please, Guido,
>> will you reconsider?
>
> Indeed, it's a silly inconsistent restriction. When it was first added I
> too suggested that any expression be allowed after the @, rather than
> having a uniquely special restricted syntax. I argued from consistency
> of grammar standpoint. But Guido was not persuaded. Good luck to you. :)
>
[snip]
I can see no syntactic reason to restrict what can appear after the @.
If someone chooses to abuse it then that's unPythonic, but not illegal.
More information about the Python-Dev
mailing list