(cls, key, *args, **kwargs)
Instantiate a subclass of `cls`.

    Args:
      key: the key identifying the subclass.
      *args: passed on to the subclass constructor.
      **kwargs: passed on to the subclass constructor.

    Returns:
      An instantiation of the subclass that has the given key.

    Raises:
      KeyError: if key is not a child subclass of cls.
Instantiate a subclass of `cls`.
Instantiate a subclass of cls .
def make(cls, key, *args, **kwargs):
    """Instantiate a subclass of `cls`.

    Args:
      key: the key identifying the subclass.
      *args: passed on to the subclass constructor.
      **kwargs: passed on to the subclass constructor.

    Returns:
      An instantiation of the subclass that has the given key.

    Raises:
      KeyError: if key is not a child subclass of cls.
    """
    for subklass in deepsubclasses(cls):
      if subklass.key == key:
        return subklass(*args, **kwargs)

    raise KeyError("unknown %s subclass key %s" % (cls, key))
def make ( cls , key , * args , * * kwargs ) : for subklass in deepsubclasses ( cls ) : if subklass . key == key : return subklass ( * args , * * kwargs ) raise KeyError ( "unknown %s subclass key %s" % ( cls , key ) )