[Python-3000] PEP 3115: Actual use cases for odd metaclasses? Alternate syntax.

Charles Merriam charles.merriam at gmail.com
Sun Jan 13 21:35:57 CET 2008


Sigh..  Yes mix-ins are about mixing classes.  No I didn't miss it.
No I'm not explaining it.  You can type 100 words to my one and not
add much.  I'm dropping metaclass changes.

Have a nice day,

Charles
On Jan 13, 2008 12:27 PM, Phillip J. Eby <pje at telecommunity.com> wrote:
> At 10:55 AM 1/13/2008 -0800, Charles Merriam wrote:
> >You have a legitimate counter-argument that grouping the
> >implementations of __add__ in the metaclass is cleaner than having
> >them stand alone and be referenced in.
>
> You've misunderstood Michele's example code.  __add__ in the
> metaclass lets you add two *record classes* together, not two records.
>
> Your proposal didn't support this behavior, nor *any other use case*
> for actually having a metaclass (as opposed to class decoration).
>
> You might find this metaclass tutorial enlightening, especially the
> section I've linked to:
>
> http://www.ibm.com/developerworks/linux/library/l-pymeta2/#h4
>
> Understanding this will show you why your original proposal is
> completely broken for non-decorator use cases.
>
>


More information about the Python-3000 mailing list