On 15 September 2016 at 21:11, אלעזר <elaz...@gmail.com> wrote:
> Yes the "class A[T]:" syntax requires on the ability to express variance as
> an operator, but not the other way around.
>
> It might be an argument in favor of switching to the + syntax: to make
> possible future syntax change in class definition somewhat easier to
> swallow.

A future syntax change is very unlikely, as people encountering "class
SomeName(Generic[+T]):" for the first time can easily google "python
generic class" and hopefully find useful answers in the documentation
for typing.Generic. By contrast, "class SomeName[+T]:" would have to
be covered directly in the class statement documentation, which runs
completely counter to the notion of type hints as executable code
annotations (rather than being an unavoidable core part of the
language the way they are in statically typed languages).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to