[Python-ideas] PEP 560 (second post)
k7hoven at gmail.com
Fri Nov 10 12:39:08 EST 2017
On Wed, Sep 27, 2017 at 12:28 PM, Ivan Levkivskyi <levkivskyi at gmail.com>
> Previously I posted PEP 560 two weeks ago, while several other PEPs were
> also posted, so it didn't get much of attention. Here I post the PEP 560
> again, now including the full text for convenience of commenting.
> After creating the class,
> the original bases are saved in ``__orig_bases__`` (currently this is also
> done by the metaclass).
Those are *still* bases, right, even if they are not in the mro? I'm not
sure if this is a naming thing or something even more.
> NOTE: These two method names are reserved for exclusive use by
> the ``typing`` module and the generic types machinery, and any other use is
> strongly discouraged.
Given the situation, that may be a good thing. But will it really work? I
think it is also strongly discouraged to invent your own dunder method
names, but people still do it.
> The reference implementation (with tests) can be found
> in _, the proposal was originally posted and discussed on
> the ``typing`` tracker, see _.
> Backwards compatibility and impact on users who don't use ``typing``:
> This proposal may break code that currently uses the names
> ``__class_getitem__`` and ``__subclass_base__``.
+ Koos Zevenhoven + http://twitter.com/k7hoven +
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas