From micro codery on typing-sig:
It was only after seeing the solution that I could find docs describing it on mypy.readthedocs. There is a note claiming that a generic self is still experimental but maybe a convention should be added to the typeshed contributing guide about using it, just like Sequence is recommended over list.
From @srittau on #5675:
I suggest that in the future we shouldn't accept __enter__() methods returning self anymore that don't use a type var.
I think we should do both of these things. We can find some existing offenders with git grep 'def __enter__(self) -> [A-Z]'.
From micro codery on typing-sig:
From @srittau on #5675:
I think we should do both of these things. We can find some existing offenders with
git grep 'def __enter__(self) -> [A-Z]'.