def as_signed(self):
        """Reinterpretation as a signed value.

        Returns
        -------
        :class:`Value`, :py:`signed(len(self))`, :ref:`assignable <lang-assignable>`

        Raises
        ------
        ValueError
            If :py:`len(self) == 0`.
        """
        if len(self) == 0:
            raise ValueError("Cannot create a 0-width signed value")
        return Operator("s", [self])
Reinterpretation as a signed value.

        Returns
        -------
        :class:`Value`, :py:`signed(len(self))`, :ref:`assignable <lang-assignable>`

        Raises
        ------
        ValueError
            If :py:`len(self) == 0`.
        
amaranth/hdl/_ast.py