Search code examples
pythonpython-3.xterminologymetaclass

What is the nomenclature for the relationship of a class to its associated metaclass?


What do we call the relationship of a class towards its associated metaclass?

I'd like to fill the blank in the following two lines:

  • Class A is the metaclass of class B.
  • Class B is the ________ of class A.

In the documentation of the class, I am documenting a metaclass I am currently writing. I find my self typing "the class associated to this metaclass" very often in the python docstrings. Is there a single word which I can use to denote this kind of relationship in a more concise manner?

Condensed example in which I'd like to use a more concise nomenclature:

def __init__(mcl, what, bases=None, dict=None):
  """
  Raises an exception if >> the class associated to this metaclass << 
  contains a valid set of configuration decorators.
  ...
  """

Solution

  • There is no official nomenclature for that. The only way to go is the full formal way: "the class B for which A is the metaclass" or equivalent.

    Technically one could just say that "class B" is an "instance of "class A" - but no other context given it would be very hard for anyone to figure out you are talking about class-metaclass relationship.

    For the specific case you mention, though, it would work, I think - you could replace ">> the class associated to this metaclass << " for ">> the class which is an instance of this metaclass << "