From 833db194f480e457b4155cc09940d4ee562b80f0 Mon Sep 17 00:00:00 2001 From: Yusuke Miyazaki Date: Wed, 27 Jun 2018 00:21:09 +0900 Subject: [PATCH] Add a convention for platform-dependent APIs to CONTRIBUTING.md --- CONTRIBUTING.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 994698cca501..4e7952399e85 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -211,7 +211,9 @@ Some further tips for good type hints: positions, in favor of covariant types like `Mapping` or `Sequence`; * avoid Union return types: https://github.com/python/mypy/issues/1693; * in Python 2, whenever possible, use `unicode` if that's the only - possible type, and `Text` if it can be either `unicode` or `bytes`. + 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. Imports in stubs are considered private (not part of the exported API) unless: