Skip to content

Submission for SC consideration: PEP 646 -- Variadic Generics #59

@gvanrossum

Description

@gvanrossum

Please consider PEP 646 for inclusion in Python 3.10. This is primarily of interest to users of static type checkers, especially projects looking to implement shape checking for tensors (an important concept in the machine learning world, where Python's dominance is seeing competition from e.g. Swift for Tensorflow).

There are some small additions to Python's syntax in the proposal, namely the * operator in subscripts and for *args in function definitions. These are essentially just new uses of the existing "sequence unpacking" concept.

The PEP has been discussed at length in the typing sig, and the python-dev mailing list has been notified.

There are reference implementations of the checking part in Pyright and Pyre. There is a nascent patch for the syntactic changes to CPython where.

/CC: @mrahtz

https://www.python.org/dev/peps/pep-0646/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions