def __format__(self, format_desc):
        """Forbidden formatting.

        ``Format`` objects cannot be directly formatted for the same reason as the ``Value``s
        they contain.
        """
        raise TypeError(f"Format object {self!r} cannot be converted to string. Use `repr` "
                        f"to print the AST, or pass it to the `Print` statement.")
Forbidden formatting.

        ``Format`` objects cannot be directly formatted for the same reason as the ``Value``s
        they contain.
        
amaranth/hdl/_ast.py