Message412682
Typeshed now has a nice self-describing type variable to annotate context managers:
Self = TypeVar('Self')
def __enter__(self: Self) -> Self:
return self
It would be nice to have that in the standard library types module as well. |
|
Date |
User |
Action |
Args |
2022-02-06 23:12:51 | rhettinger | set | recipients:
+ rhettinger, gvanrossum, JelleZijlstra |
2022-02-06 23:12:51 | rhettinger | set | messageid: <1644189171.85.0.34470950762.issue46669@roundup.psfhosted.org> |
2022-02-06 23:12:51 | rhettinger | link | issue46669 messages |
2022-02-06 23:12:51 | rhettinger | create | |
|