mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Recommend Self in CONTRIBUTING.md (#5699)
Part of #5676. Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user