On Fri, Sep 23, 2016 at 4:17 AM Nick Coghlan <ncogh...@gmail.com> wrote:
...

> As others have noted, the general idea of allowing either a
> placeholder name or the class name to refer to a suitable type
> annotation is fine, though - that would be a matter of implicitly
> injecting that name into the class namespace after calling
> __prepare__, and ensuring the compiler is aware of that behaviour,
> just as we inject __class__ as a nonlocal reference into method bodies
> that reference "super" or "__class__".
>
> Just to be sure I understand, will the following work?

class A:
    def repeat(n: int) -> List[A]: pass

Elazar
_______________________________________________
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