Skip to content

Commit 4ca8fd6

Browse files
committed
spec/directives: Process additional review comments.
1 parent 98e3697 commit 4ca8fd6

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

docs/spec/directives.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Type checkers should support the following comparison patterns:
177177
* ``sys.version_info < <2-tuple>``
178178

179179
Comparison checks are only supported against the first two elements of the version tuple.
180-
It should be noted that type checkers may choose to also support the 3-tuple ``sys.version_info >= <3-tuple>``.
180+
Type checkers may choose to also support the 3-tuple ``sys.version_info >= <3-tuple>``.
181181
Type checkers are not expected to support comparisons with named attributes of `sys.version_info`.
182182

183183
.. code-block:: python
@@ -199,6 +199,9 @@ Type checkers should support the following comparison patterns:
199199
* ``sys.platform == <string literal>``
200200
* ``sys.platform != <string literal>``
201201
* ``sys.platform.startswith(<string literal>)``
202+
* ``sys.platform in <tuple of string literals>``
203+
* ``sys.platform not in <tuple of string literals>``
204+
Type checkers may also support the following comparison patterns:
202205
* ``sys.platform in <set of string literals>``
203206
* ``sys.platform not in <set of string literals>``
204207

@@ -247,7 +250,7 @@ sys.implementation.version checks
247250

248251
``sys.implementation.version`` is a tuple, in the same format as sys.version_info. However it represents the version of the Python implementation
249252
rather than the version of the Python language. This has a distinct meaning from the specific version of the Python language to which the currently
250-
running interpreter conforms. For CPython this is the same as `sys.version_info`.
253+
running interpreter conforms. For CPython (``sys.implementation.name == "cpython"``) this is the same as `sys.version_info`.
251254

252255
Type checkers should support the following comparison patterns:
253256
* ``sys.implementation.version >= <2-tuple>``
@@ -292,7 +295,7 @@ Therefore checkers are **not required** to understand obfuscations such as:
292295
Configuration
293296
^^^^^^^^^^^^^
294297

295-
Type checkers must provide configuration or CLI options to specify target ``sys.version``, ``sys.platform``, ``sys.implementation.name`` and ``sys.implementation.version``.
298+
Type checkers must be able to retrieve the information from the python implementation's runtime environment, or provide configuration or CLI options to specify target ``sys.version``, ``sys.platform``, ``sys.implementation.name`` and ``sys.implementation.version``.
296299

297300
================================ ========================== ============== ===========================================================================
298301
Symbol Suggested Format Example Suggested Default

0 commit comments

Comments
 (0)