Re: [Python-ideas] Generics Syntax

2016-09-15 Thread אלעזר
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. ~Elazar On Thu, Sep 15,

Re: [Python-ideas] Generics Syntax

2016-09-15 Thread Nick Coghlan
On 15 September 2016 at 19:53, Ivan Levkivskyi wrote: > > > On 15 September 2016 at 11:46, אלעזר wrote: >> >> And that thread is only about variance. What about the generic syntax? > > > If you mean code like this: > > class Container[+T]: >

Re: [Python-ideas] Generics Syntax

2016-09-15 Thread אלעזר
And that thread is only about variance. What about the generic syntax? ‪On Thu, Sep 15, 2016 at 12:44 PM ‫אלעזר‬‎ wrote:‬ > Does that mean that if I did, it would be reconsidered? > > On Thu, Sep 15, 2016 at 12:43 PM Ivan Levkivskyi > wrote: > >> On 15

Re: [Python-ideas] Generics Syntax

2016-09-15 Thread אלעזר
Does that mean that if I did, it would be reconsidered? On Thu, Sep 15, 2016 at 12:43 PM Ivan Levkivskyi wrote: > On 15 September 2016 at 11:21, אלעזר wrote: > >> This suggestion is so obvious that it's likely has been discussed, but I >> can't find any

Re: [Python-ideas] Generics Syntax

2016-09-15 Thread Ivan Levkivskyi
On 15 September 2016 at 11:21, אלעזר wrote: > This suggestion is so obvious that it's likely has been discussed, but I > can't find any reference (It's not what PEP-3124 talks about). > > You might want to read this tread https://github.com/python/typing/issues/211 and another

[Python-ideas] Generics Syntax

2016-09-15 Thread אלעזר
This suggestion is so obvious that it's likely has been discussed, but I can't find any reference (It's not what PEP-3124 talks about). Generic class syntax, now: _T_co = TypeVar('_T', covariant=True) class Container(Generic[_T_co]): @abstractmethod def