def __new__(cls, name, bases, dictionary):
descriptor = dictionary[GeneratedProtocolMessageType._DESCRIPTOR_KEY]<EOL>if descriptor.full_name in well_known_types.WKTBASES:<EOL><INDENT>bases += (well_known_types.WKTBASES[descriptor.full_name],)<EOL><DEDENT>_AddClassAttributesForNestedExtensions(descriptor, dictionary)<EOL>_AddSlots(descriptor, dictionary)<EOL>superclass = super(GeneratedProtocolMessageType, cls)<EOL>new_class = superclass.__new__(cls, name, bases, dictionary)<EOL>return new_class<EOL>
Custom allocation for runtime-generated class types.

        We override __new__ because this is apparently the only place
        where we can meaningfully set __slots__ on the class we're creating(?).
        (The interplay between metaclasses and slots is not very well-documented).

        Args:
          name: Name of the class (ignored, but required by the
            metaclass protocol).
          bases: Base classes of the class we're constructing.
            (Should be message.Message).  We ignore this field, but
            it's required by the metaclass protocol
          dictionary: The class dictionary of the class we're
            constructing.  dictionary[_DESCRIPTOR_KEY] must contain
            a Descriptor object describing this protocol message
            type.

        Returns:
          Newly-allocated class.