Skip to content

Commit 14d7431

Browse files
JelleZijlstraAkuli
andauthored
Recommend Self in CONTRIBUTING.md (#5699)
Part of #5676. Co-authored-by: Akuli <[email protected]>
1 parent 58559e5 commit 14d7431

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,10 @@ are not sure whether exceptions are suppressed or not or if the
373373
context manager is meant to be subclassed, pick `Optional[bool]`.
374374
See https://github.com/python/mypy/issues/7214 for more details.
375375

376+
`__enter__` methods and other methods that return instances of the
377+
current class should be annotated with the `_typeshed.Self` type
378+
variable ([example](https://github.com/python/typeshed/pull/5698)).
379+
376380
A few guidelines for protocol names below. In cases that don't fall
377381
into any of those categories, use your best judgement.
378382

0 commit comments

Comments
 (0)