➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients JelleZijlstra, gvanrossum, rhettinger
Date 2022-02-06.23:12:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <[email protected]>
In-reply-to
Content
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.
History
Date User Action Args
2022-02-06 23:12:51rhettingersetrecipients: + rhettinger, gvanrossum, JelleZijlstra
2022-02-06 23:12:51rhettingersetmessageid: <[email protected]>
2022-02-06 23:12:51rhettingerlinkissue46669 messages
2022-02-06 23:12:51rhettingercreate