[Python-ideas] Decorator syntax restriction
Brett Cannon
brett at python.org
Fri Oct 2 19:04:07 CEST 2009
[multi-reply]
On Fri, Oct 2, 2009 at 03:43, Rob Cliffe <rob.cliffe at btinternet.com> wrote:
> Last time I wrote in favour of removing the restriction on decorator syntax,
> an unfortunate offhand remark of mine about something being more Pythonic
> led to a tangential debate about what was Pythonic and whether concision was
> always good, etc., with almost everyone ignoring the issue I was actually
> raising.
> An honourable exception was Brett Cannon, who answered my points squarely
> (and did his best to shoot me down in flames).
>
=) Glad I was an exception.
[snip]
> I wrote: "Guido has said he has a 'gut feeling' against [removing the
> restriction] but has not as far as I know rationalised it."
> Brett wrote: "When it comes to Guido's gut, a rationalization isn't needed.
> Perk of being BDFL. Plus his gut is right so often it tends to not be
> questioned."
>
> I am sure that Guido (may-he-live-forever) would be the first to agree that
> saying an opinion of his should NEVER be questioned is just, well, silly.
Very true, but in this case I agree with Guido's gut. If I didn't I
wouldn't have brought up support for it.
On Fri, Oct 2, 2009 at 08:39, Nick Coghlan <ncoghlan at gmail.com> wrote:
> Paul Moore wrote:
>> 2009/10/2 Rob Cliffe <rob.cliffe at btinternet.com>:
>>> So: please speak, if you agree with me, whether for the reasons I give or
>>> for different ones, or if you disagree with me - please give reasons too.
>>
>> I believe that the key reason for there being restrictions is to avoid
>> Python code looking like "line noise". That's not precise - the
>> specific rules as given express a sensible (in my view) balance
>> between this goal and simplicity of
>> implementation/explanation/usability.
>
> +1 to everything Paul said (including the parts I cut)
>
+1 from me as well.
> +1 to a patch that relaxes the restriction on decorations to allow
> subscript operations in addition to call operations.
+0 from me. Like Paul, after all of the decorator usage I have done
since its introduction I have never even come up against the
restriction (hell, I didn't even realize there was one until this
thread). But expanding to index syntax I could live with.
-Brett
More information about the Python-ideas
mailing list