After several rounds of debate on typing-sig, I'd like to request feedback on PEP 695: https://peps.python.org/pep-0695/
I am sponsoring this PEP, which was written by Eric Traut. The PEP attempts to solve the problem that defining generic classes, functions and type aliases currently is lacking dedicated syntax, instead using the cumbersome `T = TypeVar("T", ...)` notation to create global variables that serve as type variables. As a personal historical note, I should mention that over 22 years ago I already pondered type parameters. In an old document that I saved I found the following code snippet: ``` def f<T> (a: T) -> T: ... ``` which is eerily close to the proposal in this PEP, except that the PEP uses square brackets: ``` def f[T](a: T) -> T: ... ``` It's been a long and circuitous road! I am not quoting the entire PEP here, please follow the link: https://peps.python.org/pep-0695/ -- --Guido van Rossum (python.org/~guido)
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/65KXYQOKHMZBGBHWKU6DRGOTN6PTZHFP/ Code of Conduct: http://python.org/psf/codeofconduct/