Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Clarify language in directives regarding named attribute usage in ver…
…sion comparisons.

Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
  • Loading branch information
Josverl committed Apr 3, 2026
commit c951b00061c13259eced18e71683b2c0c43a4272
6 changes: 3 additions & 3 deletions docs/spec/directives.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Type checkers should support the following comparison patterns:
* ``sys.version_info < <2-tuple>``

Comparisons checks are only supported against the first two elements of the version tuple.
Use of named attributes is not supported.
Use of named attributes is not mandated.

.. code-block:: python
:caption: Example `sys.version_info`
Expand Down Expand Up @@ -235,7 +235,7 @@ Type checkers should support the following comparison patterns:
* ``sys.implementation.version < <2-tuple>``

Comparisons checks are only supported against the first two elements of the implementation version tuple.
Use of named attributes is not supported.
Use of named attributes is not mandated.

.. code-block:: python
:caption: Example `sys.implementation.version`
Expand All @@ -257,7 +257,7 @@ No support for complex expressions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Type checkers are only required to support the above patterns, and are not required to evaluate complex expressions involving these variables.
For example, the pattern ``sys.platform == "linux"`` is supported but other syntax variants such as ``platform == "linux"`` and ``"win" not in sys.platform`` are not supported.
For example, the pattern ``sys.platform == "linux"`` is supported but other syntax variants such as ``platform == "linux"`` and ``"win" not in sys.platform`` are not mandated.

Therefore checkers are **not required** to understand obfuscations such as:

Expand Down