Add a convention for platform-dependent APIs to CONTRIBUTING.md (#2281)

This commit is contained in:
Yusuke Miyazaki
2018-06-27 01:14:12 +09:00
committed by Jelle Zijlstra
parent de1755b263
commit b91cb87249

View File

@@ -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: