Skip to content

Consider improvements from Python 3.15 #4736

@Liam-DeVoe

Description

@Liam-DeVoe

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    internalsStuff that only Hypothesis devs should ever see

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions