Repository: Textualize/textual
File: src/textual/message.py (Python)

Code before:

    @property
    def control(self) -> DOMNode | None:
        """The widget associated with this message, or None by default."""
        return None

    @property
    def is_forwarded(self) -> bool:
        """Has the message been forwarded?"""
        return self._forwarded

    def _set_forwarded(self) -> None:
        """Mark this event as being forwarded."""
        self._forwarded = True

    def set_sender(self, sender: MessagePump) -> Self:
        """Set the sender of the message.

        Args:
            sender: The sender.

        Note:
            When creating a message the sender is automatically set;
            normally there will be no need for this method to be called.
            This method will be used when strict control is required over
            the sender of a message.

        Returns:
            Self.
        """
        self._sender = sender
        return self

    def can_replace(self, message: "Message") -> bool:
        """Check if another message may supersede this one.

        Args:
            message: Another message.

        Returns:
            True if this message may replace the given message
        """
        return False

    def prevent_default(self, prevent: bool = True) -> Message:
        """Suppress the default action(s). This will prevent handlers in any base classes
        from being called.

        Args:
            prevent: True if the default action should be suppressed,
                or False if the default actions should be performed.

Review comment (suggestion):
```suggestion
            When creating a message the sender is automatically set.
            Normally there will be no need for this method to be called.
            This method will be used when strict control is required over
            the sender of a message.
```

Code after:

    @property
    def control(self) -> DOMNode | None:
        """The widget associated with this message, or None by default."""
        return None

    @property
    def is_forwarded(self) -> bool:
        """Has the message been forwarded?"""
        return self._forwarded

    def _set_forwarded(self) -> None:
        """Mark this event as being forwarded."""
        self._forwarded = True

    def set_sender(self, sender: MessagePump) -> Self:
        """Set the sender of the message.

        Args:
            sender: The sender.

        Note:
            When creating a message the sender is automatically set.
            Normally there will be no need for this method to be called.
            This method will be used when strict control is required over
            the sender of a message.

        Returns:
            Self.
        """
        self._sender = sender
        return self

    def can_replace(self, message: "Message") -> bool:
        """Check if another message may supersede this one.

        Args:
            message: Another message.

        Returns:
            True if this message may replace the given message
        """
        return False

    def prevent_default(self, prevent: bool = True) -> Message:
        """Suppress the default action(s). This will prevent handlers in any base classes
        from being called.

        Args:
            prevent: True if the default action should be suppressed,
                or False if the default actions should be performed.