[Python-ideas] Assignment decorators (Re: The Descriptor Protocol...)
Nick Coghlan
ncoghlan at gmail.com
Wed Mar 9 16:15:26 CET 2011
On Wed, Mar 9, 2011 at 9:05 AM, Paul Moore <p.f.moore at gmail.com> wrote:
> On 9 March 2011 01:34, Terry Reedy <tjreedy at udel.edu> wrote:
>> So your point is correct:
>>
>> name = makeob('name', ...) # becomes
>>
>> keywd name ....Si
>>
>> but we do not really want a new keyword for every new type of object with a
>> definition name. Can we do with just one?
>
> >From what I recall, that's the basic idea behind the "make keyword"
> PEP. Sorry, I can't recall the PEP number or details here. It was
> rejected at the time, but it has been suggested (by Guido, I think!)
> that it might be worth reviving it.
PEP 359. The hard part is coming up with something that offers
sufficient benefits over a custom metaclass to justify new syntax.
Areas for exploration:
1. Easier to define (just define a function with an appropriate signature)
2. Ordered namespace by default
3. Significantly easier to compose (combining metaclasses can be
something of a pain)
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-ideas
mailing list