On Thu, Sep 22, 2016 at 3:58 PM, David Mertz <me...@gnosis.cx> wrote:

> It's more verbose, but you can also spell it now as:
>
> class A:
>     def __add__(self, other: type(self)) -> type(self): ...
>

No, you can't:

>>> class A:
...     def __add__(self, other: type(self)) -> type(self): ...
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in A
NameError: name 'self' is not defined
_______________________________________________
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