[Python-Dev] Adding types.build_class for 3.3

Barry Warsaw barry at python.org
Thu May 10 19:31:56 CEST 2012


On May 09, 2012, at 07:44 PM, R. David Murray wrote:

>On Thu, 10 May 2012 08:14:55 +1000, Nick Coghlan <ncoghlan at gmail.com> wrote:
>> Given that the statement form is referred to as a "class definition", and
>> this is the dynamic equivalent, I'm inclined to go with "type.define()".
>> Dynamic type definition is more consistent with existing terminology than
>> dynamic type creation.
>
>Yeah, but that's the statement form.  I think of the characters in the
>.py file as the definition.  If I'm creating a class dynamically...I'm
>creating(*) it, not defining it.

That's exactly how I think about it too.

>I don't think it's a big deal, though.  Either word will work.
>
>--David
>
>(*) Actually, come to think of it, I probably refer to it as
>"constructing" the class, rather than creating or defining it.
>It's the type equivalent of constructing an instance, perhaps?

If, as Nick proposes in a different message, it actually does make better
sense to put this as a module-level function, then putting `class` in the name
makes sense.  types.{new,create,build,construct}_class() works for me, in
roughly that order.

-Barry



More information about the Python-Dev mailing list