From 4a22a178fdbbae5c4477c522d2f2e535911f3bd7 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Sun, 6 Jul 2025 20:40:45 +0100 Subject: [PATCH] Make `ForbiddenExtraKeysError.__str__` deterministic --- src/cattrs/errors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cattrs/errors.py b/src/cattrs/errors.py index 570c2367..21012bbd 100644 --- a/src/cattrs/errors.py +++ b/src/cattrs/errors.py @@ -134,5 +134,5 @@ def __str__(self) -> str: return ( self.message or f"Extra fields in constructor for {self.cl.__name__}: " - f"{', '.join(self.extra_fields)}" + f"{', '.join(sorted(self.extra_fields))}" )