firecrown.fctools.print_hierarchy

This script provides a way to print the class hierarchy of a given type.

Attributes

app

Functions

full_type_name(t)

Return the full type name, with the module path to the type.

get_defined_methods(cls)

Return a list of method names defined in the class.

print_one_type(idx, t)

Print the direct type information for the type t.

print_type_hierarchy(top_type)

Print the class hierarchy for the given type.

main([typenames])

Print the class hierarchy for the given type(s).

Module Contents

firecrown.fctools.print_hierarchy.full_type_name(t)[source]

Return the full type name, with the module path to the type.

Parameters:

t (type)

Return type:

str

firecrown.fctools.print_hierarchy.get_defined_methods(cls)[source]

Return a list of method names defined in the class.

This includes methods introduced in this class, as well as inherited methods that are overridden in this class. It does not include methods inherited from base classes.

Return type:

list[str]

firecrown.fctools.print_hierarchy.print_one_type(idx, t)[source]

Print the direct type information for the type t.

This function does not traverse the type hierarchy; see print_type_hierarchy for that purpose.

Parameters:
  • idx (int)

  • t (type)

Return type:

None

firecrown.fctools.print_hierarchy.print_type_hierarchy(top_type)[source]

Print the class hierarchy for the given type.

Parameters:

top_type (type)

Return type:

None

firecrown.fctools.print_hierarchy.app
firecrown.fctools.print_hierarchy.main(typenames=typer.Argument(..., help='One or more fully qualified type names'))[source]

Print the class hierarchy for the given type(s).

This tool displays the Method Resolution Order (MRO) for Python classes, showing the inheritance hierarchy and all methods defined in each class.

TYPENAMES One or more fully qualified type names (e.g. mymodule.MyClass)

Parameters:

typenames (List[str])