From b089be7402e0ca9226724f80d2e4c7c20eb7b3d0 Mon Sep 17 00:00:00 2001 From: Liam DeVoe Date: Fri, 27 Dec 2024 11:51:34 -0500 Subject: [PATCH] reword release, typing --- hypothesis-python/RELEASE.rst | 2 +- .../src/hypothesis/internal/conjecture/shrinker.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hypothesis-python/RELEASE.rst b/hypothesis-python/RELEASE.rst index 2e99882c60..b70f64656f 100644 --- a/hypothesis-python/RELEASE.rst +++ b/hypothesis-python/RELEASE.rst @@ -1,3 +1,3 @@ RELEASE_TYPE: patch -The shrinker now uses the `typed choice sequence` (:issue:`3921`) to determine counterexample complexity. We expect this to mostly match the previous ordering, but it may result in reporting different counterexamples in some cases. +The shrinker now uses the typed choice sequence (:issue:`3921`) when ordering failing examples. As a result, Hypothesis may now report a different minimal failing example for some tests. We expect most cases to remain unchanged. diff --git a/hypothesis-python/src/hypothesis/internal/conjecture/shrinker.py b/hypothesis-python/src/hypothesis/internal/conjecture/shrinker.py index 952598267e..0f462f7951 100644 --- a/hypothesis-python/src/hypothesis/internal/conjecture/shrinker.py +++ b/hypothesis-python/src/hypothesis/internal/conjecture/shrinker.py @@ -80,7 +80,7 @@ def sort_key(buffer: SortKeyT) -> tuple[int, SortKeyT]: return (len(buffer), buffer) -def sort_key_ir(nodes: Sequence[IRNode]) -> tuple[int, tuple[int]]: +def sort_key_ir(nodes: Sequence[IRNode]) -> tuple[int, tuple[int, ...]]: return ( len(nodes), tuple(choice_to_index(node.value, node.kwargs) for node in nodes),