With the new variable annotation syntax, it is possible to implement a
useful "modifiers" library, all used as superclasses.
Possible modifiers:
* Named / Struct: annotation-defined fields. No monkey patching.
* Immutable / Const
* Sealed / Final: unsubclassable class
* Array: a mutable
On Fri, Sep 16, 2016 at 03:54:18AM +1000, Chris Angelico wrote:
> On Fri, Sep 16, 2016 at 3:03 AM, Steven D'Aprano wrote:
> > On Wed, Sep 14, 2016 at 09:51:32PM +1000, Chris Angelico wrote:
> >
> >> Perhaps the advice needs to be along the lines of: Decide what the
> >>
On Fri, Sep 16, 2016 at 4:06 AM, Guido van Rossum wrote:
>> Sometimes they function as integer constants (esp IntEnum), and
>> sometimes more as just arbitrary values. See the examples in the docs
>> [1] for Color and Mood, where the exact value is immaterial, just as
>> long as
On Thu, Sep 15, 2016 at 10:54 AM, Chris Angelico wrote:
> On Fri, Sep 16, 2016 at 3:03 AM, Steven D'Aprano wrote:
>> On Wed, Sep 14, 2016 at 09:51:32PM +1000, Chris Angelico wrote:
>>
>>> Perhaps the advice needs to be along the lines of: Decide what the
On Fri, Sep 16, 2016 at 3:03 AM, Steven D'Aprano wrote:
> On Wed, Sep 14, 2016 at 09:51:32PM +1000, Chris Angelico wrote:
>
>> Perhaps the advice needs to be along the lines of: Decide what the
>> purpose of the enum is, and follow a naming convention accordingly.
>>
On 09/15/2016 10:03 AM, Steven D'Aprano wrote:
On Wed, Sep 14, 2016 at 09:51:32PM +1000, Chris Angelico wrote:
Perhaps the advice needs to be along the lines of: Decide what the
purpose of the enum is, and follow a naming convention accordingly.
Uppercase if you're basically making constants;
On Wed, Sep 14, 2016 at 09:51:32PM +1000, Chris Angelico wrote:
> Perhaps the advice needs to be along the lines of: Decide what the
> purpose of the enum is, and follow a naming convention accordingly.
> Uppercase if you're basically making constants; lowercase if you're
> not; etcetera.
I
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,
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]:
>
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
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
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
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
13 matches
Mail list logo