Skip to content

Push required python version to 3.10 #646

Description

@bizfsc

As time goes by, I think it is time to push the minimal required python version once more. Why? Mainly new features for type hinting and code quality. Also 3.9 is already EOL and 3.10 is due in Oct 2026.

Actual benefits:

  • Drop typing.Union / typing.Optional and use native hinting
  • Structural Pattern Matching with match (PEP636): The library is full of if/elif chains dispatching on integer command bytes, OD object types, and NMT states. match makes this explicit, exhaustive, and readable
  • TypeAlias for Explicit Type Aliases (PEP 613): Unambiguous and readable type aliases

Activity

  1. acolomb commented on Apr 29, 2026

    @acolomb
    Member

    This is something I wanted to get started on, but haven't found the time yet. Certainly the right path forward, on all three points. But please make sure the changes re split up in smaller chunks, no "fix-all-the-things" commits that are hard to review and act as barriers in the Git history (for example when bisecting / blaming).

    Especially for the Union and Optional fixes, I think there are more important issues to work on, so we can transition to the new style gradually.

    I was pondering about a final 3.9 compatible release with the accumulated changes so far, before we take this dive.

  2. bizfsc commented on Apr 29, 2026

    @bizfsc
    CollaboratorAuthor

    This is something I wanted to get started on, but haven't found the time yet. Certainly the right path forward, on all three points. But please make sure the changes re split up in smaller chunks, no "fix-all-the-things" commits that are hard to review and act as barriers in the Git history (for example when bisecting / blaming).

    yes! totally agree, the one trivial changes PR (#647) was an exception, because there I didn't see the benefit splitting this up even more in like three or four separate PRs.

    I was pondering about a final 3.9 compatible release with the accumulated changes so far, before we take this dive.

    I think this is a very good idea. No need to rush things

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions