unitelabs.labware.utils.find_subclass

Attributes

  • Name
    T
    Type
    Value

    = typing.TypeVar('T')

    Description

Functions

  • find_subclass(cls : type[T], name : str) -> typing.Optional[type[T]]

    Recursively find a subclass with the given name.

    Parameters

    • Name
      cls
      Type
      type[T]
      Default
      Description

      The base class to start searching from.

    • Name
      name
      Type
      str
      Default
      Description

      The name of the class to find.

    Response

    Type
    typing.Optional[type[T]]
    Description

    The class with the given name, or `None` if no such class exists.

Copyright © 2024