[Python-Dev] Adding types.build_class for 3.3
Terry Reedy
tjreedy at udel.edu
Tue May 8 23:07:37 CEST 2012
On 5/8/2012 12:50 PM, Barry Warsaw wrote:
> On May 08, 2012, at 11:59 AM, Nick Coghlan wrote:
>
>> No, the "mcl" in the call is just the designated metaclass - the
>> *actual* metaclass of the resulting class definition may be something
>> different. That's why this is a separate method from mcl.__new__.
>
> I'm not completely sold on adding a class method to type, but I acknowledge
> that it's a convenient place to put it. Still, it doesn't feel particularly
> more right than adding it to say, the operator module.
The operator module strikes me as completely wrong. To me, a function
that creates classes (types) belongs either in the types module or
attached to the type metaclass. Attaching an alternate constructor to
type as a class method would be analogous to attaching an alternate dict
constructor to dict (.fromkeys).
--
Terry Jan Reedy
More information about the Python-Dev
mailing list