Skip to content

Commit

Permalink
Recommend Self in CONTRIBUTING.md
Browse files Browse the repository at this point in the history
Part of #5676.
  • Loading branch information
JelleZijlstra authored Jun 27, 2021
1 parent 1fb100d commit 9b69683
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ Some further tips for good type hints:
possible type, and `Text` if it can be either `unicode` or `bytes`;
* use platform checks like `if sys.platform == 'win32'` to denote
platform-dependent APIs.
* `__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/5689)).

Imports in stubs are considered private (not part of the exported API)
unless:
Expand Down

0 comments on commit 9b69683

Please sign in to comment.