Skip to content

Is the protocol caching still needed? #20

Description

@jorenham

Since Python 3.12 runtime-checkable typing.Protocol's use caching and some other tricks to achieve a ~20x speedup: python/cpython#102433

For older Python versions, typing-extensions provides a Protocol variant that includes (most of) these speedups (docs).
For what it's worth: It is used in the optype library, which I use for several of my (other) open- and closed-source projects, but I haven't had any problems with it at all (even though I tend to break everything typing related (not a threat BTW)) 🤷🏻.

I haven't done a benchmark, but regardless of the outcome, this could perhaps be a nice opportunity to make numerary more focused towards what all the cool kids are talking about these days: typing in Python 😎. Even fusion-powered quantum-blockchain AI has got nothing on us!

~

Hoping this banal participial closing causes no offense, I am,

Typically,

Joren S. Hammudoglu,
Typer of Things

Activity

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