#4736·hypothesis

Consider improvements from Python 3.15

Author: Liam-DeVoeCreated May 21, 2026Updated Jul 25, 2026
Labelsinternals

Python 3.15 is now in feature freeze (whatsnew), though it won't come out for another 5 months. Once it does, here are the features we should consider for Hypothesis:

  • Replace our usage of bytes(bytearray(...)) with bytearray.take_bytes, where appropriate
  • Replace UniqueIdentifier with sentinel.
    • This will resolve a long-standing pain point with type narrowing a UniqueIdentifier, because you cannot narrow against a specific instance of a UniqueIdentifier (but can against a sentinel).
  • Investigate lazy imports (https://peps.python.org/pep-0810/)
    • I need to read the lazy imports PEP more. Is there any downside if we move all of Hypothesis to lazy imports? The upside of faster import time is clear.
  • -bb is now deprecated. Should we remove it from all of our CI?
  • Can we use the new math.issubnormal, math.fmax, or math.signbit functions?

Source: HypothesisWorks/hypothesis