1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #35648 -- Raised NotImplementedError in SafeString.__add__ for non-string RHS.

This change ensures SafeString addition operations handle non-string RHS
properly, allowing them to implement __radd__ for better compatibility.
This commit is contained in:
Matthias Kestenholz
2024-08-09 17:18:42 +02:00
committed by nessita
parent b5c048f5ec
commit d84200e4eb
3 changed files with 65 additions and 5 deletions

View File

@@ -262,7 +262,10 @@ URLs
Utilities
~~~~~~~~~
* ...
* :class:`~django.utils.safestring.SafeString` now raises
:exc:`NotImplementedError` in ``__add__`` for non-string right-hand side
values. This aligns with the :py:class:`str` addition behavior and allows
``__radd__`` to be used if available.
Validators
~~~~~~~~~~