[Python-ideas] Assignment decorators (Re: The Descriptor Protocol...)
ericsnowcurrently at gmail.com
Thu Mar 10 19:22:29 CET 2011
This is the first iteration of the idea that doesn't seem confusing. The
other approaches did not seem intuitive.
On Thu, Mar 10, 2011 at 5:49 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On Thu, Mar 10, 2011 at 6:20 AM, Paul Moore <p.f.moore at gmail.com> wrote:
> > On 10 March 2011 01:37, MRAB <python at mrabarnett.plus.com> wrote:
> >>> I don't like the suggestion as written, but I quite like it as a
> >>> superior syntax proposal for PEP 359.
> >>> def (builder) name(param_spec):
> >>> code_block
> >> I think what I don't like is that the name is buried in the middle of
> >> the line and not near the start as in the "class" or "def" statement.
> > Syntactically, I have the same concern - when I first read that line I
> > didn't spot "name" at all.
> I actually agree it is a major weakness of the syntax. You can play
> games with "from" to rearrange the line. For example:
> def name from builder(param_spec):
> as sugar for:
> name = builder("name", param_spec_obj, code_obj)
> Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
> Python-ideas mailing list
> Python-ideas at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas