code: def rect(
          self,
          x: int,
          y: int,
          width: int,
          height: int,
          clear: bool,
          bg_blend: int = tcod.constants.BKGND_DEFAULT,
      ) -> None:
          
          self.__deprecate_defaults("draw_rect", bg_blend, clear=bool(clear))
          lib.TCOD_console_rect(
              self.console_c, x, y, width, height, clear, bg_blend
          )
docs: Draw a the background color on a rect optionally clearing the text.
  
          If `clear` is True the affected tiles are changed to space character.
  
          Args:
              x (int): The x coordinate from the left.
              y (int): The y coordinate from the top.
              width (int): Maximum width to render the text.
              height (int): Maximum lines to render the text.
              clear (bool): If True all text in the affected area will be
                            removed.
              bg_blend (int): Background blending flag.
  
          .. deprecated:: 8.5
              Console methods which depend on console defaults have been
              deprecated.
              Use :any:`Console.draw_rect` instead, calling this function will
              print a warning detailing which default values need to be made
              explicit.