Recommend Self in CONTRIBUTING.md (#5699)

Part of #5676.

Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
Jelle Zijlstra
2021-06-27 13:17:28 -07:00
committed by GitHub
parent 58559e56b3
commit 14d7431ff1

View File

@@ -373,6 +373,10 @@ are not sure whether exceptions are suppressed or not or if the
context manager is meant to be subclassed, pick `Optional[bool]`.
See https://github.com/python/mypy/issues/7214 for more details.
`__enter__` methods and other methods that return instances of the
current class should be annotated with the `_typeshed.Self` type
variable ([example](https://github.com/python/typeshed/pull/5698)).
A few guidelines for protocol names below. In cases that don't fall
into any of those categories, use your best judgement.