[Python-Dev] Re: Presenting PEP 695: Type Parameter Syntax

2022-07-16 Thread Stephen J. Turnbull
Paul Ganssle writes: > If you didn't already know what the square brackets did, how would > you try and find out? First I'd look it up in Python Essential Reference (Hi, @dabeaz! it won't be there, though ;-). Then I'd go to the Language Reference for "def" and "class". And if that failed,

[Python-Dev] Re: Presenting PEP 695: Type Parameter Syntax

2022-07-15 Thread Patrick Reader
On 13/07/2022 14:14, o.jacob.nils...@gmail.com wrote: Hi, I like this PEP but I couldn't find the motivation for using angle brackets over square braces (brackets?). The survey in Appendix A is great but lacks any conclusions. From that survey alone I would assume that angle brackets would

[Python-Dev] Re: Presenting PEP 695: Type Parameter Syntax

2022-07-15 Thread Paul Ganssle
I actually really like some variation on `@with type S`, or some other variation that has a keyword, because that makes it much easier for someone newly encountering one of these syntax constructs to search to figure out what it does. If you didn't already know what the square brackets did,

[Python-Dev] Re: Presenting PEP 695: Type Parameter Syntax

2022-07-14 Thread Terry Reedy
On 7/14/2022 6:16 PM, Guido van Rossum wrote: In addition, we already use square brackets for *using* generics (e.g. list[int]), and most surveyed languages use the same type of brackets in declarations and uses. I do not yet use annotations, but knowing about 'list[int]', etc, I could

[Python-Dev] Re: Presenting PEP 695: Type Parameter Syntax

2022-07-14 Thread Guido van Rossum
Yeah, we all would have liked angle brackets, but there would be problems with breaking lines between those. E.g. def foo< T: str, S: int > (arg1: T, arg2: S) -> tuple[T, S]: ... cannot be parsed because the lexer doesn't treat angle brackets as matching pairs. In addition, we

[Python-Dev] Re: Presenting PEP 695: Type Parameter Syntax

2022-07-14 Thread o . jacob . nilsson
Hi, I like this PEP but I couldn't find the motivation for using angle brackets over square braces (brackets?). The survey in Appendix A is great but lacks any conclusions. From that survey alone I would assume that angle brackets would have been chosen over square braces, given that they are

[Python-Dev] Re: Presenting PEP 695: Type Parameter Syntax

2022-07-12 Thread Jelle Zijlstra
El mar, 12 jul 2022 a las 6:15, Petr Viktorin () escribió: > On 12. 07. 22 6:30, Guido van Rossum wrote: > > 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

[Python-Dev] Re: Presenting PEP 695: Type Parameter Syntax

2022-07-12 Thread Petr Viktorin
On 12. 07. 22 6:30, Guido van Rossum wrote: 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