From dea1cd31cdd9b89c550d6be137b2e10212d34fe4 Mon Sep 17 00:00:00 2001 From: Jos Verlinde Date: Sat, 15 Aug 2026 22:15:33 +0200 Subject: [PATCH 01/10] Update specification for directives for sys.implementation and sys.platform checks. Signed-off-by: Jos Verlinde --- docs/spec/directives.rst | 144 +++++++++++++++++++++++++++++++++++---- 1 file changed, 131 insertions(+), 13 deletions(-) diff --git a/docs/spec/directives.rst b/docs/spec/directives.rst index 488d71a26..fe6aa102a 100644 --- a/docs/spec/directives.rst +++ b/docs/spec/directives.rst @@ -154,23 +154,141 @@ left undefined by the typing spec at this time. Version and platform checking ----------------------------- -Type checkers are expected to understand simple version and platform -checks, e.g.:: +Type checkers should support narrowing based on: + * ``sys.version_info`` + * ``sys.platform`` + * ``sys.implementation.version`` + * ``sys.implementation.name`` - import sys +Type checkers should support combining these checks with: + * A ``not`` unary operator + * An ``and`` or ``or`` binary operator - if sys.version_info >= (3, 12): - # Python 3.12+ - else: - # Python 3.11 and lower +Type checkers are only required to support the fully-qualified form (e.g., ``sys.platform``). +Support for aliases or import variants (e.g., ``from sys import platform``) is not required, though type checkers may choose to support them. - if sys.platform == 'win32': - # Windows specific definitions - else: - # Posix specific definitions +The comparison patterns for these variables are described in more detail in the following paragraphs. -Don't expect a checker to understand obfuscations like -``"".join(reversed(sys.platform)) == "xunil"``. +sys.version_info checks +^^^^^^^^^^^^^^^^^^^^^^^^ + +Type checkers should support the following comparison patterns: + * ``sys.version_info >= <2-tuple>`` + * ``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. + +.. code-block:: python + :caption: Example `sys.version_info` + :emphasize-lines: 2 + + import sys + if sys.version_info >= (3, 12): + # Python 3.12+ + else: + # Python 3.11 and lower + +sys.platform checks +^^^^^^^^^^^^^^^^^^^ + +Type checkers should support the following comparison patterns: + * ``sys.platform == `` + * ``sys.platform != `` + * ``sys.platform in `` + * ``sys.platform not in `` + + Common values: ``"linux"``, ``"darwin"``, ``"win32"``, ``"emscripten"``, ``"wasi"`` + +The membership checks ``in`` and ``not in``, only support simple containment testing to a tuple of literal strings. + +.. code-block:: python + :caption: Example `sys.platform` + :emphasize-lines: 2,4 + + import sys + if sys.platform == 'win32': + # Windows specific definitions + if sys.platform in ("linux", "darwin"): + # Platform-specific stubs for Linux and macOS + ... + + +sys.implementation.name checks +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type checkers should support comparison patterns: + * ``sys.implementation.name == `` + * ``sys.implementation.name != `` + * ``sys.implementation.name in `` + * ``sys.implementation.name not in `` + + Common values: ``"cpython"``, ``"pypy"``, ``"micropython"``, ``"graalpy"``, ``"jython"``, ``"ironpython"`` + +.. code-block:: python + :caption: Example `sys.implementation.name` + :emphasize-lines: 2,4 + + import sys + if sys.implementation.name == "cpython": + # CPython-specific stub + if sys.implementation.name == "micropython": + # MicroPython-specific stub + + +sys.implementation.version checks +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type checkers should support the following comparison patterns: + * ``sys.implementation.version >= <2-tuple>`` + * ``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. + +.. code-block:: python + :caption: Example `sys.implementation.version` + :emphasize-lines: 2,4 + + import sys + if sys.implementation.name == "pypy" and sys.implementation.version >= (7, 3): + # PyPy version 7.3 and above + if sys.implementation.name == "micropython" and sys.implementation.version >= (1, 24): + # MicroPython version 1.24 and above + +.. note:: + + ``sys.implementation.version`` is a tuple, in the same format as sys.version_info. However it represents the version of the Python implementation 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 running interpreter conforms. For CPython this is the same as `sys.version_info`. + + +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. + +Therefore checkers are **not required** to understand obfuscations such as: + +.. code-block:: python + :caption: Examples of unsupported or overly complex version/platform checks + :emphasize-lines: 3,5,7 + + import sys + from sys import platform + if "".join(reversed(sys.platform)) == "xunil": + # Linux specific code + if platform == "linux": + # Linux specific code + if "win" not in sys.platform: + # Non-Windows specific code + + +Configuration +^^^^^^^^^^^^^ + +Type checkers should provide configuration or CLI options to specify target sys.version, sys.platform, sys.implementation.name and sys.implementation.version. +The exact mechanism for this is implementation-defined by the type checker. .. _`deprecated`: From 51e52c5a257fb3b0e7b1e08c4bf6ec2475debe07 Mon Sep 17 00:00:00 2001 From: Jos Verlinde Date: Sat, 15 Aug 2026 22:15:33 +0200 Subject: [PATCH 02/10] Update docs/spec/directives.rst Formatting improvements. Co-authored-by: Jelle Zijlstra --- docs/spec/directives.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/directives.rst b/docs/spec/directives.rst index fe6aa102a..b70bca048 100644 --- a/docs/spec/directives.rst +++ b/docs/spec/directives.rst @@ -200,7 +200,7 @@ Type checkers should support the following comparison patterns: Common values: ``"linux"``, ``"darwin"``, ``"win32"``, ``"emscripten"``, ``"wasi"`` -The membership checks ``in`` and ``not in``, only support simple containment testing to a tuple of literal strings. +The membership checks ``in`` and ``not in`` only support simple containment testing with a tuple of literal strings. .. code-block:: python :caption: Example `sys.platform` From 5128e7456b4c6bd3d5bb339227e5414ab1449538 Mon Sep 17 00:00:00 2001 From: Jos Verlinde Date: Sat, 15 Aug 2026 22:15:33 +0200 Subject: [PATCH 03/10] Clarify language in directives regarding named attribute usage in version comparisons. Signed-off-by: Jos Verlinde --- docs/spec/directives.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/spec/directives.rst b/docs/spec/directives.rst index b70bca048..8ecc6624a 100644 --- a/docs/spec/directives.rst +++ b/docs/spec/directives.rst @@ -177,7 +177,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` @@ -244,7 +244,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` @@ -266,7 +266,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: From f928655c466e9326fd0f2a25a36570ab710fc71f Mon Sep 17 00:00:00 2001 From: Jos Verlinde Date: Sat, 15 Aug 2026 22:15:34 +0200 Subject: [PATCH 04/10] spec/directives: Process review comments. Signed-off-by: Jos Verlinde --- docs/spec/directives.rst | 64 +++++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 24 deletions(-) diff --git a/docs/spec/directives.rst b/docs/spec/directives.rst index 8ecc6624a..eae15d291 100644 --- a/docs/spec/directives.rst +++ b/docs/spec/directives.rst @@ -154,7 +154,7 @@ left undefined by the typing spec at this time. Version and platform checking ----------------------------- -Type checkers should support narrowing based on: +Type checkers should understand code paths as definitely reachable or not reachable due to comparison tests against these symbols: * ``sys.version_info`` * ``sys.platform`` * ``sys.implementation.version`` @@ -176,8 +176,9 @@ Type checkers should support the following comparison patterns: * ``sys.version_info >= <2-tuple>`` * ``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 mandated. +Comparison checks are only supported against the first two elements of the version tuple. +It should be noted that type checkers may choose to also support the 3-tuple ``sys.version_info >= <3-tuple>``. +Type checkers are not expected to support comparisons with named attributes of `sys.version_info`. .. code-block:: python :caption: Example `sys.version_info` @@ -186,8 +187,10 @@ Use of named attributes is not mandated. import sys if sys.version_info >= (3, 12): # Python 3.12+ + elif sys.version_info >= (3, 11): + # Python 3.11 else: - # Python 3.11 and lower + # Python 3.10 and lower sys.platform checks ^^^^^^^^^^^^^^^^^^^ @@ -195,12 +198,13 @@ sys.platform checks Type checkers should support the following comparison patterns: * ``sys.platform == `` * ``sys.platform != `` - * ``sys.platform in `` - * ``sys.platform not in `` + * ``sys.platform.startswith()`` + * ``sys.platform in `` + * ``sys.platform not in `` Common values: ``"linux"``, ``"darwin"``, ``"win32"``, ``"emscripten"``, ``"wasi"`` -The membership checks ``in`` and ``not in`` only support simple containment testing with a tuple of literal strings. +The membership checks ``in`` and ``not in`` only support simple containment testing with a set of literal strings. .. code-block:: python :caption: Example `sys.platform` @@ -220,11 +224,13 @@ sys.implementation.name checks Type checkers should support comparison patterns: * ``sys.implementation.name == `` * ``sys.implementation.name != `` - * ``sys.implementation.name in `` - * ``sys.implementation.name not in `` + * ``sys.implementation.name in `` + * ``sys.implementation.name not in `` + Default value: ``"cpython"``, unless configured otherwise. Common values: ``"cpython"``, ``"pypy"``, ``"micropython"``, ``"graalpy"``, ``"jython"``, ``"ironpython"`` + .. code-block:: python :caption: Example `sys.implementation.name` :emphasize-lines: 2,4 @@ -239,12 +245,16 @@ Type checkers should support comparison patterns: sys.implementation.version checks ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +``sys.implementation.version`` is a tuple, in the same format as sys.version_info. However it represents the version of the Python implementation +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 +running interpreter conforms. For CPython this is the same as `sys.version_info`. + Type checkers should support the following comparison patterns: * ``sys.implementation.version >= <2-tuple>`` * ``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 mandated. +Comparison checks are only supported against the first two elements of the implementation version tuple. +Type checkers are not required to support comparisons against named attributes of `sys.implementation.version`. .. code-block:: python :caption: Example `sys.implementation.version` @@ -256,39 +266,45 @@ Use of named attributes is not mandated. if sys.implementation.name == "micropython" and sys.implementation.version >= (1, 24): # MicroPython version 1.24 and above -.. note:: - - ``sys.implementation.version`` is a tuple, in the same format as sys.version_info. However it represents the version of the Python implementation 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 running interpreter conforms. For CPython this is the same as `sys.version_info`. - 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 mandated. +Type checkers are required to support the above patterns, and are not required to evaluate other comparisons or other syntax variants. Therefore checkers are **not required** to understand obfuscations such as: .. code-block:: python :caption: Examples of unsupported or overly complex version/platform checks - :emphasize-lines: 3,5,7 + :emphasize-lines: 4,6,8 import sys from sys import platform + if "".join(reversed(sys.platform)) == "xunil": - # Linux specific code + # Typecheckers will not be required to understand this obfuscated check if platform == "linux": - # Linux specific code + # Typecheckers will not be required to understand this import alias for sys.platform if "win" not in sys.platform: - # Non-Windows specific code + # Typecheckers will not be required to understand this reversed membership check Configuration ^^^^^^^^^^^^^ -Type checkers should provide configuration or CLI options to specify target sys.version, sys.platform, sys.implementation.name and sys.implementation.version. -The exact mechanism for this is implementation-defined by the type checker. +Type checkers must provide configuration or CLI options to specify target ``sys.version``, ``sys.platform``, ``sys.implementation.name`` and ``sys.implementation.version``. + +================================ ========================== ============== =========================================================================== + Symbol Suggested Format Example Suggested Default +================================ ========================== ============== =========================================================================== +``sys.version`` string ``"major.minor"`` ``"3.11"`` The version of the Python interpreter used to run the type checker. +``sys.platform`` lowercase string ``"linux"`` The platform of the Python interpreter used to run the type checker. +``sys.implementation.name`` lowercase string ``"cpython"`` ``"cpython"`` unless configured otherwise. +``sys.implementation.version`` string ``"major.minor"`` ``"3.14"`` The value used for ``sys.version`` unless configured otherwise. +================================ ========================== ============== =========================================================================== + +The configuration options should allow users to specify the target values for these symbols, so that type checkers can evaluate the version and platform checks correctly. +The exact mechanism and name for these configuration options is implementation-specific, and defined by each type checker. .. _`deprecated`: From bc8affa0bf23224a80e1570bd3ef0447ebd99eb9 Mon Sep 17 00:00:00 2001 From: Jos Verlinde Date: Tue, 8 Sep 2026 19:24:55 +0200 Subject: [PATCH 05/10] spec/directives: Process additional review comments. --- docs/spec/directives.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/spec/directives.rst b/docs/spec/directives.rst index eae15d291..201b99dcc 100644 --- a/docs/spec/directives.rst +++ b/docs/spec/directives.rst @@ -177,7 +177,7 @@ Type checkers should support the following comparison patterns: * ``sys.version_info < <2-tuple>`` Comparison checks are only supported against the first two elements of the version tuple. -It should be noted that type checkers may choose to also support the 3-tuple ``sys.version_info >= <3-tuple>``. +Type checkers may choose to also support the 3-tuple ``sys.version_info >= <3-tuple>``. Type checkers are not expected to support comparisons with named attributes of `sys.version_info`. .. code-block:: python @@ -199,6 +199,9 @@ Type checkers should support the following comparison patterns: * ``sys.platform == `` * ``sys.platform != `` * ``sys.platform.startswith()`` + * ``sys.platform in `` + * ``sys.platform not in `` +Type checkers may also support the following comparison patterns: * ``sys.platform in `` * ``sys.platform not in `` @@ -247,7 +250,7 @@ sys.implementation.version checks ``sys.implementation.version`` is a tuple, in the same format as sys.version_info. However it represents the version of the Python implementation 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 -running interpreter conforms. For CPython this is the same as `sys.version_info`. +running interpreter conforms. For CPython (``sys.implementation.name == "cpython"``) this is the same as `sys.version_info`. Type checkers should support the following comparison patterns: * ``sys.implementation.version >= <2-tuple>`` @@ -292,7 +295,7 @@ Therefore checkers are **not required** to understand obfuscations such as: Configuration ^^^^^^^^^^^^^ -Type checkers must provide configuration or CLI options to specify target ``sys.version``, ``sys.platform``, ``sys.implementation.name`` and ``sys.implementation.version``. +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``. ================================ ========================== ============== =========================================================================== Symbol Suggested Format Example Suggested Default From 41f0b658cb2f5aebe3eae35f2ed5f46b645752a1 Mon Sep 17 00:00:00 2001 From: Jos Verlinde Date: Mon, 21 Sep 2026 23:33:45 +0200 Subject: [PATCH 06/10] spec/directives: Process additional review comments. Also : - wrapped lines to ~85 characters - tables to 110 characters - Improved .rst formatting and markup The Intent is for these commits allow tracability of review comments, but to be squashed to a single commit during merge. Signed-off-by: Jos Verlinde --- docs/spec/directives.rst | 210 ++++++++++++++++++++++++--------------- 1 file changed, 128 insertions(+), 82 deletions(-) diff --git a/docs/spec/directives.rst b/docs/spec/directives.rst index 201b99dcc..0582ccfa9 100644 --- a/docs/spec/directives.rst +++ b/docs/spec/directives.rst @@ -154,88 +154,111 @@ left undefined by the typing spec at this time. Version and platform checking ----------------------------- -Type checkers should understand code paths as definitely reachable or not reachable due to comparison tests against these symbols: - * ``sys.version_info`` - * ``sys.platform`` - * ``sys.implementation.version`` - * ``sys.implementation.name`` +Type checkers should understand code paths as definitely reachable or not reachable +due to comparison tests against these symbols: + +* ``sys.version_info`` +* ``sys.platform`` +* ``sys.implementation.version`` +* ``sys.implementation.name`` Type checkers should support combining these checks with: - * A ``not`` unary operator - * An ``and`` or ``or`` binary operator -Type checkers are only required to support the fully-qualified form (e.g., ``sys.platform``). -Support for aliases or import variants (e.g., ``from sys import platform``) is not required, though type checkers may choose to support them. +* A ``not`` unary operator +* An ``and`` or ``or`` binary operator + +Type checkers are only required to support the fully-qualified form +(e.g., ``sys.platform``). Support for aliases or import variants +(e.g., ``from sys import platform``) is not required, though type checkers may +choose to support them. -The comparison patterns for these variables are described in more detail in the following paragraphs. +The comparison patterns for these variables are described in more detail in the +following paragraphs. sys.version_info checks ^^^^^^^^^^^^^^^^^^^^^^^^ Type checkers should support the following comparison patterns: - * ``sys.version_info >= <2-tuple>`` - * ``sys.version_info < <2-tuple>`` -Comparison checks are only supported against the first two elements of the version tuple. -Type checkers may choose to also support the 3-tuple ``sys.version_info >= <3-tuple>``. -Type checkers are not expected to support comparisons with named attributes of `sys.version_info`. +* ``sys.version_info >= <2-tuple>`` +* ``sys.version_info < <2-tuple>`` + +where ``<2-tuple>`` is a literal tuple of two literal integers. + +Comparison checks are only supported against the first two elements of the version +tuple. Type checkers may choose to also support the 3-tuple +``sys.version_info >= <3-tuple>``. Type checkers are not expected to support +comparisons with named attributes of ``sys.version_info``. .. code-block:: python - :caption: Example `sys.version_info` - :emphasize-lines: 2 + :caption: Examples of ``sys.version_info`` checks + :emphasize-lines: 2,4 import sys - if sys.version_info >= (3, 12): - # Python 3.12+ - elif sys.version_info >= (3, 11): - # Python 3.11 - else: + if sys.version_info >= (3, 13): + # Python 3.13+ + elif sys.version_info < (3, 11): # Python 3.10 and lower + else: + # Python 3.11, 3.12 sys.platform checks ^^^^^^^^^^^^^^^^^^^ Type checkers should support the following comparison patterns: - * ``sys.platform == `` - * ``sys.platform != `` - * ``sys.platform.startswith()`` - * ``sys.platform in `` - * ``sys.platform not in `` -Type checkers may also support the following comparison patterns: - * ``sys.platform in `` - * ``sys.platform not in `` - Common values: ``"linux"``, ``"darwin"``, ``"win32"``, ``"emscripten"``, ``"wasi"`` +* ``sys.platform == `` +* ``sys.platform != `` +* ``sys.platform.startswith()`` +* ``sys.platform in `` +* ``sys.platform in `` +* ``sys.platform in `` +* ``sys.platform not in `` +* ``sys.platform not in `` +* ``sys.platform not in `` + +Common values: ``"linux"``, ``"darwin"``, ``"win32"``, ``"emscripten"``, +``"wasi"`` -The membership checks ``in`` and ``not in`` only support simple containment testing with a set of literal strings. +The membership checks ``in`` and ``not in`` only support simple containment +testing with a tuple, set, or list of literal strings. .. code-block:: python - :caption: Example `sys.platform` - :emphasize-lines: 2,4 + :caption: Examples of ``sys.platform`` checks + :emphasize-lines: 2,4,6,8 import sys - if sys.platform == 'win32': - # Windows specific definitions - if sys.platform in ("linux", "darwin"): + if sys.platform == "win32": + # Windows-specific definitions + elif sys.platform in ("linux", "darwin"): # Platform-specific stubs for Linux and macOS - ... + elif sys.platform.startswith("freebsd"): + # FreeBSD-specific stubs, including versions such as "freebsd8" + if sys.platform not in ["wasi", "emscripten"]: + # Stubs for platforms other than WASI and Emscripten sys.implementation.name checks ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type checkers should support comparison patterns: - * ``sys.implementation.name == `` - * ``sys.implementation.name != `` - * ``sys.implementation.name in `` - * ``sys.implementation.name not in `` - Default value: ``"cpython"``, unless configured otherwise. - Common values: ``"cpython"``, ``"pypy"``, ``"micropython"``, ``"graalpy"``, ``"jython"``, ``"ironpython"`` +* ``sys.implementation.name == `` +* ``sys.implementation.name != `` +* ``sys.implementation.name in `` +* ``sys.implementation.name in `` +* ``sys.implementation.name in `` +* ``sys.implementation.name not in `` +* ``sys.implementation.name not in `` +* ``sys.implementation.name not in `` + +Default value: ``"cpython"``, unless configured otherwise. +Common values: ``"cpython"``, ``"pypy"``, ``"micropython"``, ``"graalpy"``, +``"jython"``, ``"ironpython"`` .. code-block:: python - :caption: Example `sys.implementation.name` + :caption: Examples of ``sys.implementation.name`` checks :emphasize-lines: 2,4 import sys @@ -248,66 +271,89 @@ Type checkers should support comparison patterns: sys.implementation.version checks ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -``sys.implementation.version`` is a tuple, in the same format as sys.version_info. However it represents the version of the Python implementation -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 -running interpreter conforms. For CPython (``sys.implementation.name == "cpython"``) this is the same as `sys.version_info`. +The value of ``sys.implementation.version`` is a tuple, in the same format as +``sys.version_info``. However, it represents the version of the +*Python implementation* 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 running interpreter conforms. + +For CPython (``sys.implementation.name == "cpython"``) this is the same as +``sys.version_info``. +For other Python implementations the value of ``sys.implementation.version`` may +differ and must be specified according to the type checkers' +configuration options. If it is not specified, type checkers should issue a warning +or error if it is used in a type-checking context. Type checkers should support the following comparison patterns: - * ``sys.implementation.version >= <2-tuple>`` - * ``sys.implementation.version < <2-tuple>`` -Comparison checks are only supported against the first two elements of the implementation version tuple. -Type checkers are not required to support comparisons against named attributes of `sys.implementation.version`. +* ``sys.implementation.version >= <2-tuple>`` +* ``sys.implementation.version < <2-tuple>`` + +Comparison checks are only supported against the first two elements of the +implementation version tuple. Type checkers are not required to support comparisons +against named attributes of ``sys.implementation.version``. .. code-block:: python - :caption: Example `sys.implementation.version` + :caption: Examples of ``sys.implementation.version`` checks :emphasize-lines: 2,4 import sys if sys.implementation.name == "pypy" and sys.implementation.version >= (7, 3): # PyPy version 7.3 and above - if sys.implementation.name == "micropython" and sys.implementation.version >= (1, 24): + elif sys.implementation.name == "micropython" and sys.implementation.version >= (1, 24): # MicroPython version 1.24 and above -No support for complex expressions -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Required forms and optional extensions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Type checkers are required to support the above patterns, and are not required to evaluate other comparisons or other syntax variants. - -Therefore checkers are **not required** to understand obfuscations such as: +Type checkers must support the forms described above. They may support additional +comparisons and syntax forms, but are not required to recognize them. For example, +type checkers are not required to support the following forms: .. code-block:: python - :caption: Examples of unsupported or overly complex version/platform checks - :emphasize-lines: 4,6,8 + :caption: Examples of forms that type checkers are not required to support + :emphasize-lines: 4,6,8 - import sys - from sys import platform + import sys + from sys import platform - if "".join(reversed(sys.platform)) == "xunil": - # Typecheckers will not be required to understand this obfuscated check - if platform == "linux": - # Typecheckers will not be required to understand this import alias for sys.platform - if "win" not in sys.platform: - # Typecheckers will not be required to understand this reversed membership check + if "".join(reversed(sys.platform)) == "xunil": + # Comparison using a computed value + if platform == "linux": + # Comparison using an imported alias + if "win" not in sys.platform: + # Substring membership test against sys.platform Configuration ^^^^^^^^^^^^^ -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``. - -================================ ========================== ============== =========================================================================== - Symbol Suggested Format Example Suggested Default -================================ ========================== ============== =========================================================================== -``sys.version`` string ``"major.minor"`` ``"3.11"`` The version of the Python interpreter used to run the type checker. -``sys.platform`` lowercase string ``"linux"`` The platform of the Python interpreter used to run the type checker. -``sys.implementation.name`` lowercase string ``"cpython"`` ``"cpython"`` unless configured otherwise. -``sys.implementation.version`` string ``"major.minor"`` ``"3.14"`` The value used for ``sys.version`` unless configured otherwise. -================================ ========================== ============== =========================================================================== - -The configuration options should allow users to specify the target values for these symbols, so that type checkers can evaluate the version and platform checks correctly. -The exact mechanism and name for these configuration options is implementation-specific, and defined by each type checker. +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``. + +============================== ======================== ============= ===================================== +Symbol Suggested Format Example Suggested Default +============================== ======================== ============= ===================================== +``sys.version_info`` string ``"major.minor"`` ``"3.11"`` The version of the Python interpreter + used to run the type checker. +``sys.platform`` lowercase string ``"linux"`` The platform of the Python interpreter + used to run the type checker. +``sys.implementation.name`` lowercase string ``"cpython"`` ``"cpython"`` unless configured + otherwise. +``sys.implementation.version`` string ``"major.minor"`` ``"3.14"`` On CPython, default to the value used + for ``sys.version``. On other + implementations, the value must be + provided according to the type + checker's configuration options. +============================== ======================== ============= ===================================== + +The configuration options should allow users to specify the target values for these +symbols, so that type checkers can evaluate the version and platform checks +correctly. The exact mechanism and names for these configuration options are +implementation-specific and defined by each type checker. .. _`deprecated`: From a81264b1f61bbb628c029739233c197e6d3c2530 Mon Sep 17 00:00:00 2001 From: Jos Verlinde Date: Mon, 19 Oct 2026 23:30:17 +0200 Subject: [PATCH 07/10] Address review comments and suggestions. Minor changes to wording and formatting. Signed-off-by: Jos Verlinde --- docs/spec/directives.rst | 90 ++++++++++++++++++++++++---------------- 1 file changed, 54 insertions(+), 36 deletions(-) diff --git a/docs/spec/directives.rst b/docs/spec/directives.rst index 0582ccfa9..4380fc34a 100644 --- a/docs/spec/directives.rst +++ b/docs/spec/directives.rst @@ -167,7 +167,7 @@ Type checkers should support combining these checks with: * A ``not`` unary operator * An ``and`` or ``or`` binary operator -Type checkers are only required to support the fully-qualified form +Type checkers are only required to support the fully qualified form (e.g., ``sys.platform``). Support for aliases or import variants (e.g., ``from sys import platform``) is not required, though type checkers may choose to support them. @@ -185,10 +185,10 @@ Type checkers should support the following comparison patterns: where ``<2-tuple>`` is a literal tuple of two literal integers. -Comparison checks are only supported against the first two elements of the version -tuple. Type checkers may choose to also support the 3-tuple -``sys.version_info >= <3-tuple>``. Type checkers are not expected to support -comparisons with named attributes of ``sys.version_info``. +Required support is limited to comparisons against literal two-element tuples. +Type checkers may choose to also support comparisons against three-element tuple +literals: ``sys.version_info >= <3-tuple>``. Type checkers are not expected to +support comparisons with named attributes of ``sys.version_info``. .. code-block:: python :caption: Examples of ``sys.version_info`` checks @@ -210,18 +210,18 @@ Type checkers should support the following comparison patterns: * ``sys.platform == `` * ``sys.platform != `` * ``sys.platform.startswith()`` -* ``sys.platform in `` -* ``sys.platform in `` -* ``sys.platform in `` -* ``sys.platform not in `` -* ``sys.platform not in `` -* ``sys.platform not in `` +* ``sys.platform in `` +* ``sys.platform in `` +* ``sys.platform in `` +* ``sys.platform not in `` +* ``sys.platform not in `` +* ``sys.platform not in `` Common values: ``"linux"``, ``"darwin"``, ``"win32"``, ``"emscripten"``, ``"wasi"`` The membership checks ``in`` and ``not in`` only support simple containment -testing with a tuple, set, or list of literal strings. +testing with a literal tuple, literal set, or literal list of literal strings. .. code-block:: python :caption: Examples of ``sys.platform`` checks @@ -241,21 +241,22 @@ testing with a tuple, set, or list of literal strings. sys.implementation.name checks ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Type checkers should support comparison patterns: +Type checkers should support these comparison patterns with +``sys.implementation.name``: * ``sys.implementation.name == `` * ``sys.implementation.name != `` -* ``sys.implementation.name in `` -* ``sys.implementation.name in `` -* ``sys.implementation.name in `` -* ``sys.implementation.name not in `` -* ``sys.implementation.name not in `` -* ``sys.implementation.name not in `` +* ``sys.implementation.name in `` +* ``sys.implementation.name in `` +* ``sys.implementation.name in `` +* ``sys.implementation.name not in `` +* ``sys.implementation.name not in `` +* ``sys.implementation.name not in `` Default value: ``"cpython"``, unless configured otherwise. Common values: ``"cpython"``, ``"pypy"``, ``"micropython"``, ``"graalpy"``, -``"jython"``, ``"ironpython"`` +``"android"``, ``"ios"``, ``"ironpython"`` .. code-block:: python :caption: Examples of ``sys.implementation.name`` checks @@ -271,7 +272,7 @@ Common values: ``"cpython"``, ``"pypy"``, ``"micropython"``, ``"graalpy"``, sys.implementation.version checks ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The value of ``sys.implementation.version`` is a tuple, in the same format as +The value of ``sys.implementation.version`` is a tuple, in a similar format as ``sys.version_info``. However, it represents the version of the *Python implementation* rather than the version of the *Python language*. This has a distinct meaning from the specific version of the Python language to which the @@ -280,18 +281,18 @@ currently running interpreter conforms. For CPython (``sys.implementation.name == "cpython"``) this is the same as ``sys.version_info``. For other Python implementations the value of ``sys.implementation.version`` may -differ and must be specified according to the type checkers' -configuration options. If it is not specified, type checkers should issue a warning -or error if it is used in a type-checking context. +be specified in the type checker configuration or discovered at runtime. Type checkers should support the following comparison patterns: * ``sys.implementation.version >= <2-tuple>`` * ``sys.implementation.version < <2-tuple>`` -Comparison checks are only supported against the first two elements of the -implementation version tuple. Type checkers are not required to support comparisons -against named attributes of ``sys.implementation.version``. +Required support is limited to comparisons against literal two-element tuples. +Type checkers may choose to also support comparisons against three-element tuple +literals of ``sys.implementation.version``. +Type checkers are not required to support comparisons against named attributes +of ``sys.implementation.version``. .. code-block:: python :caption: Examples of ``sys.implementation.version`` checks @@ -304,11 +305,29 @@ against named attributes of ``sys.implementation.version``. # MicroPython version 1.24 and above +os.name checks +^^^^^^^^^^^^^^ + +Type checkers may optionally support comparisons of ``os.name`` with string +literals. + +* ``os.name == `` +* ``os.name != `` + +.. code-block:: python + :caption: Example of an ``os.name`` check + :emphasize-lines: 3 + + import os + + if os.name == "posix": + # POSIX-specific code + Required forms and optional extensions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Type checkers must support the forms described above. They may support additional -comparisons and syntax forms, but are not required to recognize them. For example, +Type checkers must support the forms specified above as required. Support for additional +comparison patterns and syntax forms is optional. For example, type checkers are not required to support the following forms: .. code-block:: python @@ -325,13 +344,12 @@ type checkers are not required to support the following forms: if "win" not in sys.platform: # Substring membership test against sys.platform - Configuration ^^^^^^^^^^^^^ -Type checkers must be able to retrieve the information from the Python +Type checkers should 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``, +to specify target ``sys.version_info``, ``sys.platform``, ``sys.implementation.name`` and ``sys.implementation.version``. ============================== ======================== ============= ===================================== @@ -344,10 +362,10 @@ Symbol Suggested Format Example Suggested ``sys.implementation.name`` lowercase string ``"cpython"`` ``"cpython"`` unless configured otherwise. ``sys.implementation.version`` string ``"major.minor"`` ``"3.14"`` On CPython, default to the value used - for ``sys.version``. On other - implementations, the value must be - provided according to the type - checker's configuration options. + for ``sys.version_info``. On other + implementations, the value should be + provided in configuration or + otherwise inferred. ============================== ======================== ============= ===================================== The configuration options should allow users to specify the target values for these From 9f941e31b0e1eb3928e0dda0f9ed565f11991629 Mon Sep 17 00:00:00 2001 From: Jos Verlinde Date: Fri, 23 Oct 2026 16:24:12 +0200 Subject: [PATCH 08/10] Add additional version or platform conformance tests. Signed-off-by: Jos Verlinde --- .../tests/directives_implementation_name.py | 134 ++++++++++++++ .../directives_implementation_version.py | 41 +++++ .../tests/directives_platform_checks.py | 171 ++++++++++++++++++ .../tests/directives_version_platform.py | 45 ++++- .../directives_version_platform_boolean.py | 131 ++++++++++++++ 5 files changed, 520 insertions(+), 2 deletions(-) create mode 100644 conformance/tests/directives_implementation_name.py create mode 100644 conformance/tests/directives_implementation_version.py create mode 100644 conformance/tests/directives_platform_checks.py create mode 100644 conformance/tests/directives_version_platform_boolean.py diff --git a/conformance/tests/directives_implementation_name.py b/conformance/tests/directives_implementation_name.py new file mode 100644 index 000000000..7073af494 --- /dev/null +++ b/conformance/tests/directives_implementation_name.py @@ -0,0 +1,134 @@ +""" +Tests implementation-name equality and membership checks. + +These tests use the suite's Python 3.12 target and default CPython implementation. +""" + +# Specification: https://typing.python.org/en/latest/spec/directives.html#version-and-platform-checks + +import sys +from typing import assert_type + + +def test_name_equality(a: int, b: str) -> None: + # > Default value: ``"cpython"``, unless configured otherwise. + error: int = 0 + equal: int | str + if sys.implementation.name == "cpython": + error = "reachable" # E + equal = a + else: + error = "unreachable" + equal = b + assert_type(equal, int) + + unequal: int | str + if sys.implementation.name != "cpython": + error = "unreachable" + unequal = b + else: + error = "reachable" # E + unequal = a + assert_type(unequal, int) + + other: int | str + if sys.implementation.name == "micropython": + error = "unreachable" + other = b + elif sys.implementation.name != "micropython": + error = "reachable" # E + other = a + else: + error = "unreachable" + other = b + assert_type(other, int) + + +def test_name_tuple_membership(a: int, b: str) -> None: + error: int = 0 + contained: int | str + if sys.implementation.name in ("cpython", "pypy"): + error = "reachable" # E + contained = a + else: + error = "unreachable" + contained = b + assert_type(contained, int) + + excluded: int | str + if sys.implementation.name not in ("cpython",): + error = "unreachable" + excluded = b + else: + error = "reachable" # E + excluded = a + assert_type(excluded, int) + + if sys.implementation.name in ("micropython",): + error = "unreachable" + else: + error = "reachable" # E + if sys.implementation.name not in ("micropython", "pypy"): + error = "reachable" # E + else: + error = "unreachable" + + +def test_name_set_membership(a: int, b: str) -> None: + error: int = 0 + contained: int | str + if sys.implementation.name in {"cpython", "pypy"}: + error = "reachable" # E + contained = a + else: + error = "unreachable" + contained = b + assert_type(contained, int) + + excluded: int | str + if sys.implementation.name not in {"cpython"}: + error = "unreachable" + excluded = b + else: + error = "reachable" # E + excluded = a + assert_type(excluded, int) + + if sys.implementation.name in {"micropython"}: + error = "unreachable" + else: + error = "reachable" # E + if sys.implementation.name not in {"micropython", "pypy"}: + error = "reachable" # E + else: + error = "unreachable" + + +def test_name_list_membership(a: int, b: str) -> None: + error: int = 0 + contained: int | str + if sys.implementation.name in ["cpython", "pypy"]: + error = "reachable" # E + contained = a + else: + error = "unreachable" + contained = b + assert_type(contained, int) + + excluded: int | str + if sys.implementation.name not in ["cpython"]: + error = "unreachable" + excluded = b + else: + error = "reachable" # E + excluded = a + assert_type(excluded, int) + + if sys.implementation.name in ["micropython"]: + error = "unreachable" + else: + error = "reachable" # E + if sys.implementation.name not in ["micropython", "pypy"]: + error = "reachable" # E + else: + error = "unreachable" diff --git a/conformance/tests/directives_implementation_version.py b/conformance/tests/directives_implementation_version.py new file mode 100644 index 000000000..d6c6efc60 --- /dev/null +++ b/conformance/tests/directives_implementation_version.py @@ -0,0 +1,41 @@ +""" +Tests the CPython implementation-version default. + +These tests use the suite's Python 3.12 target and default CPython implementation. +""" + +# Specification: https://typing.python.org/en/latest/spec/directives.html#version-and-platform-checks + +import sys +from typing import assert_type + + +def test_implementation_version(a: int, b: str) -> None: + # For the default CPython target, use the configured language version. + error: int = 0 + at_boundary: int | str + if sys.implementation.version >= (3, 12): + error = "reachable" # E + at_boundary = a + else: + error = "unreachable" + at_boundary = b + assert_type(at_boundary, int) + + below_boundary: int | str + if sys.implementation.version < (3, 12): + error = "unreachable" + below_boundary = b + else: + error = "reachable" # E + below_boundary = a + assert_type(below_boundary, int) + + if sys.implementation.version < (3, 100): + error = "reachable" # E + else: + error = "unreachable" + if sys.implementation.version >= (3, 100): + error = "unreachable" + else: + error = "reachable" # E diff --git a/conformance/tests/directives_platform_checks.py b/conformance/tests/directives_platform_checks.py new file mode 100644 index 000000000..dee97e856 --- /dev/null +++ b/conformance/tests/directives_platform_checks.py @@ -0,0 +1,171 @@ +""" +Tests platform comparisons, literal containment, and prefix checks. +""" + +# Specification: https://typing.python.org/en/latest/spec/directives.html#version-and-platform-checks + +import sys +from typing import assert_type + + +def test_equality(a: int, b: str) -> None: + error: int = 0 + equal: int | str + if sys.platform == "bogus_platform": + error = "unreachable" + equal = b + else: + error = "reachable" # E + equal = a + assert_type(equal, int) + + unequal: int | str + if sys.platform != "bogus_platform": + error = "reachable" # E + unequal = a + else: + error = "unreachable" + unequal = b + assert_type(unequal, int) + + +def test_startswith(a: int, b: str) -> None: + error: int = 0 + empty_prefix: int | str + if sys.platform.startswith(""): + error = "reachable" # E: Every platform starts with the empty prefix. + empty_prefix = a + else: + error = "unreachable" + empty_prefix = b + assert_type(empty_prefix, int) + + unknown_prefix: int | str + if sys.platform.startswith("bogus_platform"): + error = "unreachable" + unknown_prefix = b + else: + error = "reachable" # E + unknown_prefix = a + assert_type(unknown_prefix, int) + + +def test_versioned_platform_prefix() -> None: + error: int = 0 + if sys.platform == "freebsd13": + if sys.platform.startswith("freebsd"): + error = "reachable" # E[freebsd_match] + else: + error = "unreachable" + if sys.platform.startswith("linux"): + error = "unreachable" + else: + error = "reachable" # E[freebsd_nonmatch] + else: + error = "reachable" # E[freebsd_match] + error = "reachable" # E[freebsd_nonmatch] + + +def test_tuple_membership(a: int, b: str) -> None: + # > The membership checks ``in`` and ``not in`` only support simple containment + # > testing with a literal tuple, literal set, or literal list of literal strings. + error: int = 0 + contained: int | str + if sys.platform in ("bogus_platform",): + error = "unreachable" + contained = b + else: + error = "reachable" # E + contained = a + assert_type(contained, int) + + excluded: int | str + if sys.platform not in ("bogus_platform", "another_bogus_platform"): + error = "reachable" # E + excluded = a + else: + error = "unreachable" + excluded = b + assert_type(excluded, int) + + # Positive matches are guarded so this file also works on non-Linux targets. + if sys.platform == "linux": + if sys.platform in ("linux", "darwin"): + error = "reachable" # E[tuple_match] + else: + error = "unreachable" + if sys.platform not in ("linux",): + error = "unreachable" + else: + error = "reachable" # E[tuple_nonmatch] + else: + error = "reachable" # E[tuple_match] + error = "reachable" # E[tuple_nonmatch] + + +def test_set_membership(a: int, b: str) -> None: + error: int = 0 + contained: int | str + if sys.platform in {"bogus_platform"}: + error = "unreachable" + contained = b + else: + error = "reachable" # E + contained = a + assert_type(contained, int) + + excluded: int | str + if sys.platform not in {"bogus_platform", "another_bogus_platform"}: + error = "reachable" # E + excluded = a + else: + error = "unreachable" + excluded = b + assert_type(excluded, int) + + if sys.platform == "linux": + if sys.platform in {"linux", "darwin"}: + error = "reachable" # E[set_match] + else: + error = "unreachable" + if sys.platform not in {"linux"}: + error = "unreachable" + else: + error = "reachable" # E[set_nonmatch] + else: + error = "reachable" # E[set_match] + error = "reachable" # E[set_nonmatch] + + +def test_list_membership(a: int, b: str) -> None: + error: int = 0 + contained: int | str + if sys.platform in ["bogus_platform"]: + error = "unreachable" + contained = b + else: + error = "reachable" # E + contained = a + assert_type(contained, int) + + excluded: int | str + if sys.platform not in ["bogus_platform", "another_bogus_platform"]: + error = "reachable" # E + excluded = a + else: + error = "unreachable" + excluded = b + assert_type(excluded, int) + + if sys.platform == "linux": + if sys.platform in ["linux", "darwin"]: + error = "reachable" # E[list_match] + else: + error = "unreachable" + if sys.platform not in ["linux"]: + error = "unreachable" + else: + error = "reachable" # E[list_nonmatch] + else: + error = "reachable" # E[list_match] + error = "reachable" # E[list_nonmatch] diff --git a/conformance/tests/directives_version_platform.py b/conformance/tests/directives_version_platform.py index 463c0e4d6..2709ef718 100644 --- a/conformance/tests/directives_version_platform.py +++ b/conformance/tests/directives_version_platform.py @@ -23,7 +23,7 @@ def test(a: int, b: str): else: val2 = b - assert_type(val2, int) # E?: May not generate an error (support for three-element sys.version is optional) + assert_type(val2, int) # E?: Support for three-element sys.version_info is optional. if sys.version_info < (3, 8): val3 = "" @@ -39,7 +39,7 @@ def test(a: int, b: str): else: val5 = b - assert_type(val5, int) # E?: May not generate an error (support for three-element sys.version is optional) + assert_type(val5, int) # E?: Support for three-element sys.version_info is optional. if sys.platform == "bogus_platform": @@ -73,3 +73,44 @@ def test(a: int, b: str): does_not_raise = val12 # E?: should not error if `os.name` control flow is supported, but might be flagged as possibly undefined otherwise this_raises = val13 # E?: `val13` is undefined, but support for `os.name` is optional + + +def test_version_boundaries(a: int, b: str) -> None: + # The conformance suite targets Python 3.12. + # > Required support is limited to comparisons against literal two-element tuples. + error: int = 0 + at_boundary: int | str + if sys.version_info >= (3, 12): + error = "reachable" # E: The boundary is inclusive. + at_boundary = a + else: + error = "unreachable" + at_boundary = b + assert_type(at_boundary, int) + + below_boundary: int | str + if sys.version_info < (3, 12): + error = "unreachable" + below_boundary = b + else: + error = "reachable" # E: The boundary is exclusive. + below_boundary = a + assert_type(below_boundary, int) + + +def test_version_elif(a: int, b: str) -> None: + error: int = 0 + selected: int | str + if sys.version_info >= (3, 100): + error = "unreachable" + selected = b + elif sys.version_info < (3, 8): + error = "unreachable" + selected = b + elif sys.version_info >= (3, 8): + error = "reachable" # E: Only this branch is reachable. + selected = a + else: + error = "unreachable" + selected = b + assert_type(selected, int) diff --git a/conformance/tests/directives_version_platform_boolean.py b/conformance/tests/directives_version_platform_boolean.py new file mode 100644 index 000000000..fa972c5cf --- /dev/null +++ b/conformance/tests/directives_version_platform_boolean.py @@ -0,0 +1,131 @@ +""" +Tests Boolean combinations of version, platform, and implementation checks. +""" + +# Specification: https://typing.python.org/en/latest/spec/directives.html#version-and-platform-checks + +import sys +from typing import assert_type + + +def test_not(a: int, b: str) -> None: + # > Type checkers should support combining these checks with: + # > * A ``not`` unary operator + error: int = 0 + selected: int | str + if not (sys.platform == "bogus_platform"): + error = "reachable" # E + selected = a + else: + error = "unreachable" + selected = b + assert_type(selected, int) + + if not (sys.version_info >= (3, 8)): + error = "unreachable" + else: + error = "reachable" # E + + if not (sys.platform in ("bogus_platform",)): + error = "reachable" # E + else: + error = "unreachable" + + +def test_and(a: int, b: str) -> None: + # > * An ``and`` or ``or`` binary operator + error: int = 0 + selected: int | str + if sys.version_info >= (3, 8) and sys.platform != "bogus_platform": + error = "reachable" # E + selected = a + else: + error = "unreachable" + selected = b + assert_type(selected, int) + + if sys.version_info >= (3, 8) and sys.platform == "bogus_platform": + error = "unreachable" + else: + error = "reachable" # E + if sys.version_info < (3, 8) and sys.platform != "bogus_platform": + error = "unreachable" + else: + error = "reachable" # E + if sys.version_info < (3, 8) and sys.platform == "bogus_platform": + error = "unreachable" + else: + error = "reachable" # E + + +def test_or(a: int, b: str) -> None: + error: int = 0 + selected: int | str + if sys.version_info < (3, 8) or sys.platform == "bogus_platform": + error = "unreachable" + selected = b + else: + error = "reachable" # E + selected = a + assert_type(selected, int) + + if sys.version_info >= (3, 8) or sys.platform == "bogus_platform": + error = "reachable" # E + else: + error = "unreachable" + if sys.version_info < (3, 8) or sys.platform != "bogus_platform": + error = "reachable" # E + else: + error = "unreachable" + if sys.version_info >= (3, 8) or sys.platform != "bogus_platform": + error = "reachable" # E + else: + error = "unreachable" + + +def test_nested_elif(a: int, b: str) -> None: + error: int = 0 + selected: int | str + if not (sys.version_info >= (3, 8) or sys.platform != "bogus_platform"): + error = "unreachable" + selected = b + elif sys.version_info >= (3, 8) and ( + sys.platform == "bogus_platform" or sys.platform != "bogus_platform" + ): + error = "reachable" # E + selected = a + else: + error = "unreachable" + selected = b + assert_type(selected, int) + + +def test_implementation_combinations(a: int, b: str) -> None: + error: int = 0 + selected: int | str + if sys.implementation.name == "cpython" and ( + sys.implementation.version >= (3, 12) + and not (sys.platform in ["bogus_platform"]) + ): + error = "reachable" # E + selected = a + elif sys.implementation.name == "micropython" and ( + sys.implementation.version >= (1, 24) + ): + error = "unreachable" + selected = b + else: + error = "unreachable" + selected = b + assert_type(selected, int) + + if not (sys.implementation.name in {"cpython", "pypy"}): + error = "unreachable" + else: + error = "reachable" # E + if sys.implementation.name != "cpython" or ( + sys.implementation.version < (3, 12) + ): + error = "unreachable" + else: + error = "reachable" # E From 13933ad7758ece5efcd9e5cd2bd52841d16d6bc0 Mon Sep 17 00:00:00 2001 From: Jos Verlinde Date: Fri, 23 Oct 2026 16:24:12 +0200 Subject: [PATCH 09/10] Document version and platform checking conformance approach. Signed-off-by: Jos Verlinde --- conformance/README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/conformance/README.md b/conformance/README.md index 0b60a9490..8c51f521d 100644 --- a/conformance/README.md +++ b/conformance/README.md @@ -91,6 +91,32 @@ To add a new test, create a new ".py" file in the `tests` directory. Its name mu If a test is updated (augmented or fixed), the process is similar to when adding a new test. Run the conformance test tool to generate new results and manually examine the output of each supported type checker. Then update the conformance status accordingly. Once the conformance status has been updated, rerun the conformance test tool to regenerate the summary report. +## Version and Platform Checking Tests + +The version and implementation checks use the suite's Python 3.12 CPython target, +with no implementation override. Tests cover both reachable and unreachable +branches: intentional errors in reachable branches must be reported, errors in +unreachable branches must be suppressed, and `assert_type` checks verify branch +selection. Existing three-element version comparisons and `os.name` checks remain +optional; tuple, set, and list membership checks are required. + +Platform tests use nonexistent platform names for portable nonmatches and guard +positive Linux membership checks with `sys.platform == "linux"`. Tagged errors in +the outer `else` branch keep the expectations valid on non-Linux targets. Run on a +Linux target to exercise the positive membership cases. Prefix checks include the +empty prefix (always a match) and a nonexistent prefix (never a match). A guarded +`freebsd13` scenario tests a matching `freebsd` prefix and a nonmatching `linux` +prefix; run with a `freebsd13` target to exercise these branches. + +The ordinary suite does not validate all target configuration mechanisms. Separate +targeted runs are needed for Windows/Linux selection, the versioned FreeBSD +scenario, and non-CPython implementation versions distinct from the language version. +The current runner has no target-scenario matrix, and the checker CLIs examined +for this change expose language-version/platform options but no implementation-name +or implementation-version options. Non-CPython configuration coverage is therefore +deferred until suitable checker support is available; missing implementation-check +support is still recorded in the ordinary conformance results. + ## Updating a Type Checker Type checker versions are locked in `uv.lock`. From 41941f2f0d824b18cbb4e840710e73291b7c19ec Mon Sep 17 00:00:00 2001 From: Jos Verlinde Date: Fri, 23 Oct 2026 19:10:28 +0200 Subject: [PATCH 10/10] Conformance: Add conformance results for implementation and platform checks. - Introduced new TOML files for various conformance results related to directives implementation version, platform checks, and version/platform boolean checks. - Marked conformance as "Unsupported" or "Partial" based on the ability to prune branches for specific checks. - Documented unexpected errors and output related to type assignment issues, particularly with `Literal` types and incompatible types in assignments. - Updated existing TOML files to include additional error messages for unresolved references and type assertion failures. Signed-off-by: Jos Verlinde --- .../mypy/directives_implementation_name.toml | 74 ++++++++ .../directives_implementation_version.toml | 25 +++ .../mypy/directives_platform_checks.toml | 63 +++++++ .../mypy/directives_version_platform.toml | 3 + .../directives_version_platform_boolean.toml | 36 ++++ .../directives_implementation_name.toml | 74 ++++++++ .../directives_implementation_version.toml | 25 +++ .../directives_platform_checks.toml | 71 +++++++ .../directives_version_platform.toml | 3 + .../directives_version_platform_boolean.toml | 49 +++++ .../directives_implementation_name.toml | 74 ++++++++ .../directives_implementation_version.toml | 25 +++ .../pyrefly/directives_platform_checks.toml | 23 +++ .../pyrefly/directives_version_platform.toml | 3 + .../directives_version_platform_boolean.toml | 34 ++++ .../directives_implementation_name.toml | 105 +++++++++++ .../directives_implementation_version.toml | 33 ++++ .../pyright/directives_platform_checks.toml | 103 ++++++++++ .../pyright/directives_version_platform.toml | 6 + .../directives_version_platform_boolean.toml | 56 ++++++ conformance/results/results.html | 176 ++++++++++++++++-- .../ty/directives_implementation_name.toml | 74 ++++++++ .../ty/directives_implementation_version.toml | 25 +++ .../ty/directives_platform_checks.toml | 51 +++++ .../ty/directives_version_platform.toml | 3 + .../directives_version_platform_boolean.toml | 34 ++++ .../zuban/directives_implementation_name.toml | 74 ++++++++ .../directives_implementation_version.toml | 25 +++ .../zuban/directives_platform_checks.toml | 63 +++++++ .../zuban/directives_version_platform.toml | 3 + .../directives_version_platform_boolean.toml | 36 ++++ 31 files changed, 1437 insertions(+), 12 deletions(-) create mode 100644 conformance/results/mypy/directives_implementation_name.toml create mode 100644 conformance/results/mypy/directives_implementation_version.toml create mode 100644 conformance/results/mypy/directives_platform_checks.toml create mode 100644 conformance/results/mypy/directives_version_platform_boolean.toml create mode 100644 conformance/results/pycroscope/directives_implementation_name.toml create mode 100644 conformance/results/pycroscope/directives_implementation_version.toml create mode 100644 conformance/results/pycroscope/directives_platform_checks.toml create mode 100644 conformance/results/pycroscope/directives_version_platform_boolean.toml create mode 100644 conformance/results/pyrefly/directives_implementation_name.toml create mode 100644 conformance/results/pyrefly/directives_implementation_version.toml create mode 100644 conformance/results/pyrefly/directives_platform_checks.toml create mode 100644 conformance/results/pyrefly/directives_version_platform_boolean.toml create mode 100644 conformance/results/pyright/directives_implementation_name.toml create mode 100644 conformance/results/pyright/directives_implementation_version.toml create mode 100644 conformance/results/pyright/directives_platform_checks.toml create mode 100644 conformance/results/pyright/directives_version_platform_boolean.toml create mode 100644 conformance/results/ty/directives_implementation_name.toml create mode 100644 conformance/results/ty/directives_implementation_version.toml create mode 100644 conformance/results/ty/directives_platform_checks.toml create mode 100644 conformance/results/ty/directives_version_platform_boolean.toml create mode 100644 conformance/results/zuban/directives_implementation_name.toml create mode 100644 conformance/results/zuban/directives_implementation_version.toml create mode 100644 conformance/results/zuban/directives_platform_checks.toml create mode 100644 conformance/results/zuban/directives_version_platform_boolean.toml diff --git a/conformance/results/mypy/directives_implementation_name.toml b/conformance/results/mypy/directives_implementation_name.toml new file mode 100644 index 000000000..595690e5f --- /dev/null +++ b/conformance/results/mypy/directives_implementation_name.toml @@ -0,0 +1,74 @@ +conformant = "Unsupported" +notes = """ +Does not prune branches for sys.implementation.name equality or membership checks. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 21: Unexpected errors ['directives_implementation_name.py:21: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 23: Unexpected errors ['directives_implementation_name.py:23: error: Expression is of type "int | str", not "int" [assert-type]'] +Line 27: Unexpected errors ['directives_implementation_name.py:27: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 32: Unexpected errors ['directives_implementation_name.py:32: error: Expression is of type "int | str", not "int" [assert-type]'] +Line 36: Unexpected errors ['directives_implementation_name.py:36: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 42: Unexpected errors ['directives_implementation_name.py:42: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 44: Unexpected errors ['directives_implementation_name.py:44: error: Expression is of type "int | str", not "int" [assert-type]'] +Line 54: Unexpected errors ['directives_implementation_name.py:54: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 56: Unexpected errors ['directives_implementation_name.py:56: error: Expression is of type "int | str", not "int" [assert-type]'] +Line 60: Unexpected errors ['directives_implementation_name.py:60: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 65: Unexpected errors ['directives_implementation_name.py:65: error: Expression is of type "int | str", not "int" [assert-type]'] +Line 68: Unexpected errors ['directives_implementation_name.py:68: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 74: Unexpected errors ['directives_implementation_name.py:74: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 84: Unexpected errors ['directives_implementation_name.py:84: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 86: Unexpected errors ['directives_implementation_name.py:86: error: Expression is of type "int | str", not "int" [assert-type]'] +Line 90: Unexpected errors ['directives_implementation_name.py:90: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 95: Unexpected errors ['directives_implementation_name.py:95: error: Expression is of type "int | str", not "int" [assert-type]'] +Line 98: Unexpected errors ['directives_implementation_name.py:98: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 104: Unexpected errors ['directives_implementation_name.py:104: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 114: Unexpected errors ['directives_implementation_name.py:114: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 116: Unexpected errors ['directives_implementation_name.py:116: error: Expression is of type "int | str", not "int" [assert-type]'] +Line 120: Unexpected errors ['directives_implementation_name.py:120: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 125: Unexpected errors ['directives_implementation_name.py:125: error: Expression is of type "int | str", not "int" [assert-type]'] +Line 128: Unexpected errors ['directives_implementation_name.py:128: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 134: Unexpected errors ['directives_implementation_name.py:134: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +""" +output = """ +directives_implementation_name.py:18: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:21: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:23: error: Expression is of type "int | str", not "int" [assert-type] +directives_implementation_name.py:27: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:30: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:32: error: Expression is of type "int | str", not "int" [assert-type] +directives_implementation_name.py:36: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:39: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:42: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:44: error: Expression is of type "int | str", not "int" [assert-type] +directives_implementation_name.py:51: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:54: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:56: error: Expression is of type "int | str", not "int" [assert-type] +directives_implementation_name.py:60: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:63: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:65: error: Expression is of type "int | str", not "int" [assert-type] +directives_implementation_name.py:68: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:70: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:72: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:74: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:81: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:84: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:86: error: Expression is of type "int | str", not "int" [assert-type] +directives_implementation_name.py:90: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:93: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:95: error: Expression is of type "int | str", not "int" [assert-type] +directives_implementation_name.py:98: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:100: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:102: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:104: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:111: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:114: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:116: error: Expression is of type "int | str", not "int" [assert-type] +directives_implementation_name.py:120: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:123: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:125: error: Expression is of type "int | str", not "int" [assert-type] +directives_implementation_name.py:128: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:130: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:132: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:134: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +""" diff --git a/conformance/results/mypy/directives_implementation_version.toml b/conformance/results/mypy/directives_implementation_version.toml new file mode 100644 index 000000000..ba532781e --- /dev/null +++ b/conformance/results/mypy/directives_implementation_version.toml @@ -0,0 +1,25 @@ +conformant = "Unsupported" +notes = """ +Does not prune branches for sys.implementation.version comparisons using the CPython target version. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 21: Unexpected errors ['directives_implementation_version.py:21: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 23: Unexpected errors ['directives_implementation_version.py:23: error: Expression is of type "int | str", not "int" [assert-type]'] +Line 27: Unexpected errors ['directives_implementation_version.py:27: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 32: Unexpected errors ['directives_implementation_version.py:32: error: Expression is of type "int | str", not "int" [assert-type]'] +Line 37: Unexpected errors ['directives_implementation_version.py:37: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 39: Unexpected errors ['directives_implementation_version.py:39: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +""" +output = """ +directives_implementation_version.py:18: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_version.py:21: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_version.py:23: error: Expression is of type "int | str", not "int" [assert-type] +directives_implementation_version.py:27: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_version.py:30: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_version.py:32: error: Expression is of type "int | str", not "int" [assert-type] +directives_implementation_version.py:35: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_version.py:37: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_version.py:39: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_version.py:41: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +""" diff --git a/conformance/results/mypy/directives_platform_checks.toml b/conformance/results/mypy/directives_platform_checks.toml new file mode 100644 index 000000000..df27a0a43 --- /dev/null +++ b/conformance/results/mypy/directives_platform_checks.toml @@ -0,0 +1,63 @@ +conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not prune branches for tuple, set, or list membership and nonmembership checks. +""" +errors_diff = """ +Line 75: Unexpected errors ['directives_platform_checks.py:75: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 80: Unexpected errors ['directives_platform_checks.py:80: error: Expression is of type "int | str", not "int" [assert-type]'] +Line 87: Unexpected errors ['directives_platform_checks.py:87: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 89: Unexpected errors ['directives_platform_checks.py:89: error: Expression is of type "int | str", not "int" [assert-type]'] +Line 96: Unexpected errors ['directives_platform_checks.py:96: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 98: Unexpected errors ['directives_platform_checks.py:98: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 110: Unexpected errors ['directives_platform_checks.py:110: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 115: Unexpected errors ['directives_platform_checks.py:115: error: Expression is of type "int | str", not "int" [assert-type]'] +Line 122: Unexpected errors ['directives_platform_checks.py:122: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 124: Unexpected errors ['directives_platform_checks.py:124: error: Expression is of type "int | str", not "int" [assert-type]'] +Line 130: Unexpected errors ['directives_platform_checks.py:130: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 132: Unexpected errors ['directives_platform_checks.py:132: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 144: Unexpected errors ['directives_platform_checks.py:144: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 149: Unexpected errors ['directives_platform_checks.py:149: error: Expression is of type "int | str", not "int" [assert-type]'] +Line 156: Unexpected errors ['directives_platform_checks.py:156: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 158: Unexpected errors ['directives_platform_checks.py:158: error: Expression is of type "int | str", not "int" [assert-type]'] +Line 164: Unexpected errors ['directives_platform_checks.py:164: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 166: Unexpected errors ['directives_platform_checks.py:166: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +""" +output = """ +directives_platform_checks.py:18: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:24: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:36: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:48: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:65: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:66: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:75: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:78: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:80: error: Expression is of type "int | str", not "int" [assert-type] +directives_platform_checks.py:84: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:87: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:89: error: Expression is of type "int | str", not "int" [assert-type] +directives_platform_checks.py:94: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:96: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:98: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:100: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:110: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:113: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:115: error: Expression is of type "int | str", not "int" [assert-type] +directives_platform_checks.py:119: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:122: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:124: error: Expression is of type "int | str", not "int" [assert-type] +directives_platform_checks.py:128: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:130: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:132: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:134: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:144: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:147: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:149: error: Expression is of type "int | str", not "int" [assert-type] +directives_platform_checks.py:153: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:156: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:158: error: Expression is of type "int | str", not "int" [assert-type] +directives_platform_checks.py:162: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:164: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:166: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:168: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +""" diff --git a/conformance/results/mypy/directives_version_platform.toml b/conformance/results/mypy/directives_version_platform.toml index 80c6eecff..e58a1916f 100644 --- a/conformance/results/mypy/directives_version_platform.toml +++ b/conformance/results/mypy/directives_version_platform.toml @@ -9,6 +9,9 @@ directives_version_platform.py:33: error: Name "val3" is not defined; did you me directives_version_platform.py:42: error: Expression is of type "int | str", not "int" [assert-type] directives_version_platform.py:50: error: Name "val6" is not defined [name-defined] directives_version_platform.py:59: error: Name "val9" is not defined [name-defined] +directives_version_platform.py:84: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform.py:96: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform.py:111: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/directives_version_platform_boolean.toml b/conformance/results/mypy/directives_version_platform_boolean.toml new file mode 100644 index 000000000..4a3aae5f8 --- /dev/null +++ b/conformance/results/mypy/directives_version_platform_boolean.toml @@ -0,0 +1,36 @@ +conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not prune branches for negated platform membership or combinations involving implementation checks. +""" +errors_diff = """ +Line 32: Unexpected errors ['directives_version_platform_boolean.py:32: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 115: Unexpected errors ['directives_version_platform_boolean.py:115: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 118: Unexpected errors ['directives_version_platform_boolean.py:118: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 120: Unexpected errors ['directives_version_platform_boolean.py:120: error: Expression is of type "int | str", not "int" [assert-type]'] +Line 123: Unexpected errors ['directives_version_platform_boolean.py:123: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 129: Unexpected errors ['directives_version_platform_boolean.py:129: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +""" +output = """ +directives_version_platform_boolean.py:17: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:27: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:30: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:32: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:40: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:50: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:54: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:58: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:68: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:73: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:77: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:81: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:95: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:110: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:115: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:118: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:120: error: Expression is of type "int | str", not "int" [assert-type] +directives_version_platform_boolean.py:123: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:125: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:129: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:131: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +""" diff --git a/conformance/results/pycroscope/directives_implementation_name.toml b/conformance/results/pycroscope/directives_implementation_name.toml new file mode 100644 index 000000000..3656c2c8e --- /dev/null +++ b/conformance/results/pycroscope/directives_implementation_name.toml @@ -0,0 +1,74 @@ +conformant = "Unsupported" +notes = """ +Does not prune branches for sys.implementation.name equality or membership checks. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 21: Unexpected errors ["./directives_implementation_name.py:21:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 23: Unexpected errors ['./directives_implementation_name.py:23:16: int | str is not equivalent to int'] +Line 27: Unexpected errors ["./directives_implementation_name.py:27:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 32: Unexpected errors ['./directives_implementation_name.py:32:16: str | int is not equivalent to int'] +Line 36: Unexpected errors ["./directives_implementation_name.py:36:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 42: Unexpected errors ["./directives_implementation_name.py:42:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 44: Unexpected errors ['./directives_implementation_name.py:44:16: str | int is not equivalent to int'] +Line 54: Unexpected errors ["./directives_implementation_name.py:54:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 56: Unexpected errors ['./directives_implementation_name.py:56:16: int | str is not equivalent to int'] +Line 60: Unexpected errors ["./directives_implementation_name.py:60:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 65: Unexpected errors ['./directives_implementation_name.py:65:16: str | int is not equivalent to int'] +Line 68: Unexpected errors ["./directives_implementation_name.py:68:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 74: Unexpected errors ["./directives_implementation_name.py:74:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 84: Unexpected errors ["./directives_implementation_name.py:84:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 86: Unexpected errors ['./directives_implementation_name.py:86:16: int | str is not equivalent to int'] +Line 90: Unexpected errors ["./directives_implementation_name.py:90:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 95: Unexpected errors ['./directives_implementation_name.py:95:16: str | int is not equivalent to int'] +Line 98: Unexpected errors ["./directives_implementation_name.py:98:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 104: Unexpected errors ["./directives_implementation_name.py:104:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 114: Unexpected errors ["./directives_implementation_name.py:114:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 116: Unexpected errors ['./directives_implementation_name.py:116:16: int | str is not equivalent to int'] +Line 120: Unexpected errors ["./directives_implementation_name.py:120:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 125: Unexpected errors ['./directives_implementation_name.py:125:16: str | int is not equivalent to int'] +Line 128: Unexpected errors ["./directives_implementation_name.py:128:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 134: Unexpected errors ["./directives_implementation_name.py:134:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +""" +output = """ +./directives_implementation_name.py:18:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_implementation_name.py:21:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_implementation_name.py:23:16: int | str is not equivalent to int +./directives_implementation_name.py:27:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_implementation_name.py:30:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_implementation_name.py:32:16: str | int is not equivalent to int +./directives_implementation_name.py:36:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_implementation_name.py:39:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_implementation_name.py:42:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_implementation_name.py:44:16: str | int is not equivalent to int +./directives_implementation_name.py:51:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_implementation_name.py:54:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_implementation_name.py:56:16: int | str is not equivalent to int +./directives_implementation_name.py:60:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_implementation_name.py:63:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_implementation_name.py:65:16: str | int is not equivalent to int +./directives_implementation_name.py:68:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_implementation_name.py:70:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_implementation_name.py:72:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_implementation_name.py:74:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_implementation_name.py:81:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_implementation_name.py:84:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_implementation_name.py:86:16: int | str is not equivalent to int +./directives_implementation_name.py:90:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_implementation_name.py:93:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_implementation_name.py:95:16: str | int is not equivalent to int +./directives_implementation_name.py:98:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_implementation_name.py:100:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_implementation_name.py:102:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_implementation_name.py:104:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_implementation_name.py:111:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_implementation_name.py:114:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_implementation_name.py:116:16: int | str is not equivalent to int +./directives_implementation_name.py:120:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_implementation_name.py:123:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_implementation_name.py:125:16: str | int is not equivalent to int +./directives_implementation_name.py:128:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_implementation_name.py:130:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_implementation_name.py:132:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_implementation_name.py:134:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/directives_implementation_version.toml b/conformance/results/pycroscope/directives_implementation_version.toml new file mode 100644 index 000000000..9905857c1 --- /dev/null +++ b/conformance/results/pycroscope/directives_implementation_version.toml @@ -0,0 +1,25 @@ +conformant = "Unsupported" +notes = """ +Does not prune branches for sys.implementation.version comparisons using the CPython target version. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 21: Unexpected errors ["./directives_implementation_version.py:21:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 23: Unexpected errors ['./directives_implementation_version.py:23:16: int | str is not equivalent to int'] +Line 27: Unexpected errors ["./directives_implementation_version.py:27:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 32: Unexpected errors ['./directives_implementation_version.py:32:16: str | int is not equivalent to int'] +Line 37: Unexpected errors ["./directives_implementation_version.py:37:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 39: Unexpected errors ["./directives_implementation_version.py:39:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +""" +output = """ +./directives_implementation_version.py:18:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_implementation_version.py:21:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_implementation_version.py:23:16: int | str is not equivalent to int +./directives_implementation_version.py:27:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_implementation_version.py:30:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_implementation_version.py:32:16: str | int is not equivalent to int +./directives_implementation_version.py:35:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_implementation_version.py:37:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_implementation_version.py:39:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_implementation_version.py:41:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/directives_platform_checks.toml b/conformance/results/pycroscope/directives_platform_checks.toml new file mode 100644 index 000000000..15997fccb --- /dev/null +++ b/conformance/results/pycroscope/directives_platform_checks.toml @@ -0,0 +1,71 @@ +conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not prune branches for startswith or tuple, set, or list membership and nonmembership checks. +""" +errors_diff = """ +Line 39: Unexpected errors ["./directives_platform_checks.py:39:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 41: Unexpected errors ['./directives_platform_checks.py:41:16: int | str is not equivalent to int'] +Line 45: Unexpected errors ["./directives_platform_checks.py:45:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 50: Unexpected errors ['./directives_platform_checks.py:50:16: str | int is not equivalent to int'] +Line 75: Unexpected errors ["./directives_platform_checks.py:75:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 80: Unexpected errors ['./directives_platform_checks.py:80:16: str | int is not equivalent to int'] +Line 87: Unexpected errors ["./directives_platform_checks.py:87:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 89: Unexpected errors ['./directives_platform_checks.py:89:16: int | str is not equivalent to int'] +Line 96: Unexpected errors ["./directives_platform_checks.py:96:12: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 98: Unexpected errors ["./directives_platform_checks.py:98:12: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 110: Unexpected errors ["./directives_platform_checks.py:110:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 115: Unexpected errors ['./directives_platform_checks.py:115:16: str | int is not equivalent to int'] +Line 122: Unexpected errors ["./directives_platform_checks.py:122:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 124: Unexpected errors ['./directives_platform_checks.py:124:16: int | str is not equivalent to int'] +Line 130: Unexpected errors ["./directives_platform_checks.py:130:12: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 132: Unexpected errors ["./directives_platform_checks.py:132:12: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 144: Unexpected errors ["./directives_platform_checks.py:144:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 149: Unexpected errors ['./directives_platform_checks.py:149:16: str | int is not equivalent to int'] +Line 156: Unexpected errors ["./directives_platform_checks.py:156:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 158: Unexpected errors ['./directives_platform_checks.py:158:16: int | str is not equivalent to int'] +Line 164: Unexpected errors ["./directives_platform_checks.py:164:12: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 166: Unexpected errors ["./directives_platform_checks.py:166:12: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +""" +output = """ +./directives_platform_checks.py:18:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_platform_checks.py:24:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_platform_checks.py:36:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_platform_checks.py:39:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_platform_checks.py:41:16: int | str is not equivalent to int +./directives_platform_checks.py:45:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_platform_checks.py:48:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_platform_checks.py:50:16: str | int is not equivalent to int +./directives_platform_checks.py:65:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_platform_checks.py:66:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_platform_checks.py:75:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_platform_checks.py:78:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_platform_checks.py:80:16: str | int is not equivalent to int +./directives_platform_checks.py:84:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_platform_checks.py:87:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_platform_checks.py:89:16: int | str is not equivalent to int +./directives_platform_checks.py:94:12: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_platform_checks.py:96:12: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_platform_checks.py:98:12: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_platform_checks.py:100:12: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_platform_checks.py:110:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_platform_checks.py:113:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_platform_checks.py:115:16: str | int is not equivalent to int +./directives_platform_checks.py:119:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_platform_checks.py:122:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_platform_checks.py:124:16: int | str is not equivalent to int +./directives_platform_checks.py:128:12: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_platform_checks.py:130:12: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_platform_checks.py:132:12: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_platform_checks.py:134:12: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_platform_checks.py:144:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_platform_checks.py:147:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_platform_checks.py:149:16: str | int is not equivalent to int +./directives_platform_checks.py:153:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_platform_checks.py:156:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_platform_checks.py:158:16: int | str is not equivalent to int +./directives_platform_checks.py:162:12: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_platform_checks.py:164:12: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_platform_checks.py:166:12: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_platform_checks.py:168:12: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/directives_version_platform.toml b/conformance/results/pycroscope/directives_version_platform.toml index a6ce7215d..3ca982d04 100644 --- a/conformance/results/pycroscope/directives_version_platform.toml +++ b/conformance/results/pycroscope/directives_version_platform.toml @@ -9,4 +9,7 @@ output = """ ./directives_version_platform.py:67:21: val11 may be used uninitialized [possibly_undefined_name] ./directives_version_platform.py:74:21: val12 may be used uninitialized [possibly_undefined_name] ./directives_version_platform.py:75:18: val13 may be used uninitialized [possibly_undefined_name] +./directives_version_platform.py:84:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_version_platform.py:96:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_version_platform.py:111:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] """ diff --git a/conformance/results/pycroscope/directives_version_platform_boolean.toml b/conformance/results/pycroscope/directives_version_platform_boolean.toml new file mode 100644 index 000000000..cf423f9b9 --- /dev/null +++ b/conformance/results/pycroscope/directives_version_platform_boolean.toml @@ -0,0 +1,49 @@ +conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not fully prune branches for and/or combinations of version and platform checks. +Does not prune branches for negated platform membership or combinations involving implementation checks. +""" +errors_diff = """ +Line 32: Unexpected errors ["./directives_version_platform_boolean.py:32:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 43: Unexpected errors ["./directives_version_platform_boolean.py:43:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 45: Unexpected errors ['./directives_version_platform_boolean.py:45:16: int | str is not equivalent to int'] +Line 65: Unexpected errors ["./directives_version_platform_boolean.py:65:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 70: Unexpected errors ['./directives_version_platform_boolean.py:70:16: str | int is not equivalent to int'] +Line 98: Unexpected errors ["./directives_version_platform_boolean.py:98:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 100: Unexpected errors ['./directives_version_platform_boolean.py:100:16: int | str is not equivalent to int'] +Line 115: Unexpected errors ["./directives_version_platform_boolean.py:115:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 118: Unexpected errors ["./directives_version_platform_boolean.py:118:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 120: Unexpected errors ['./directives_version_platform_boolean.py:120:16: int | str is not equivalent to int'] +Line 123: Unexpected errors ["./directives_version_platform_boolean.py:123:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +Line 129: Unexpected errors ["./directives_version_platform_boolean.py:129:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment]"] +""" +output = """ +./directives_version_platform_boolean.py:17:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:27:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:30:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:32:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:40:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:43:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:45:16: int | str is not equivalent to int +./directives_version_platform_boolean.py:50:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:54:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:58:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:65:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:68:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:70:16: str | int is not equivalent to int +./directives_version_platform_boolean.py:73:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:77:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:81:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:95:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:98:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:100:16: int | str is not equivalent to int +./directives_version_platform_boolean.py:110:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:115:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:118:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:120:16: int | str is not equivalent to int +./directives_version_platform_boolean.py:123:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:125:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:129:8: Incompatible assignment: expected int, got Literal['unreachable'] [incompatible_assignment] +./directives_version_platform_boolean.py:131:8: Incompatible assignment: expected int, got Literal['reachable'] [incompatible_assignment] +""" diff --git a/conformance/results/pyrefly/directives_implementation_name.toml b/conformance/results/pyrefly/directives_implementation_name.toml new file mode 100644 index 000000000..914dcc17f --- /dev/null +++ b/conformance/results/pyrefly/directives_implementation_name.toml @@ -0,0 +1,74 @@ +conformant = "Unsupported" +notes = """ +Does not prune branches for sys.implementation.name equality or membership checks. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 21: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +Line 23: Unexpected errors ['assert_type(int | str, int) failed [assert-type]'] +Line 27: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +Line 32: Unexpected errors ['assert_type(int | str, int) failed [assert-type]'] +Line 36: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +Line 42: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +Line 44: Unexpected errors ['assert_type(int | str, int) failed [assert-type]'] +Line 54: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +Line 56: Unexpected errors ['assert_type(int | str, int) failed [assert-type]'] +Line 60: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +Line 65: Unexpected errors ['assert_type(int | str, int) failed [assert-type]'] +Line 68: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +Line 74: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +Line 84: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +Line 86: Unexpected errors ['assert_type(int | str, int) failed [assert-type]'] +Line 90: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +Line 95: Unexpected errors ['assert_type(int | str, int) failed [assert-type]'] +Line 98: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +Line 104: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +Line 114: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +Line 116: Unexpected errors ['assert_type(int | str, int) failed [assert-type]'] +Line 120: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +Line 125: Unexpected errors ['assert_type(int | str, int) failed [assert-type]'] +Line 128: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +Line 134: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +""" +output = """ +ERROR directives_implementation_name.py:18:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:21:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:23:16-28: assert_type(int | str, int) failed [assert-type] +ERROR directives_implementation_name.py:27:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:30:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:32:16-30: assert_type(int | str, int) failed [assert-type] +ERROR directives_implementation_name.py:36:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:39:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:42:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:44:16-28: assert_type(int | str, int) failed [assert-type] +ERROR directives_implementation_name.py:51:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:54:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:56:16-32: assert_type(int | str, int) failed [assert-type] +ERROR directives_implementation_name.py:60:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:63:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:65:16-31: assert_type(int | str, int) failed [assert-type] +ERROR directives_implementation_name.py:68:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:70:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:72:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:74:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:81:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:84:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:86:16-32: assert_type(int | str, int) failed [assert-type] +ERROR directives_implementation_name.py:90:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:93:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:95:16-31: assert_type(int | str, int) failed [assert-type] +ERROR directives_implementation_name.py:98:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:100:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:102:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:104:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:111:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:114:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:116:16-32: assert_type(int | str, int) failed [assert-type] +ERROR directives_implementation_name.py:120:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:123:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:125:16-31: assert_type(int | str, int) failed [assert-type] +ERROR directives_implementation_name.py:128:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:130:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:132:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_name.py:134:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/directives_implementation_version.toml b/conformance/results/pyrefly/directives_implementation_version.toml new file mode 100644 index 000000000..d81c12d72 --- /dev/null +++ b/conformance/results/pyrefly/directives_implementation_version.toml @@ -0,0 +1,25 @@ +conformant = "Unsupported" +notes = """ +Does not prune branches for sys.implementation.version comparisons using the CPython target version. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 21: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +Line 23: Unexpected errors ['assert_type(int | str, int) failed [assert-type]'] +Line 27: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +Line 32: Unexpected errors ['assert_type(int | str, int) failed [assert-type]'] +Line 37: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +Line 39: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +""" +output = """ +ERROR directives_implementation_version.py:18:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_version.py:21:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_version.py:23:16-34: assert_type(int | str, int) failed [assert-type] +ERROR directives_implementation_version.py:27:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_version.py:30:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_version.py:32:16-37: assert_type(int | str, int) failed [assert-type] +ERROR directives_implementation_version.py:35:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_version.py:37:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_version.py:39:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_implementation_version.py:41:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/directives_platform_checks.toml b/conformance/results/pyrefly/directives_platform_checks.toml new file mode 100644 index 000000000..8a55b452e --- /dev/null +++ b/conformance/results/pyrefly/directives_platform_checks.toml @@ -0,0 +1,23 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +ERROR directives_platform_checks.py:18:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_platform_checks.py:24:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_platform_checks.py:36:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_platform_checks.py:48:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_platform_checks.py:65:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_platform_checks.py:66:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_platform_checks.py:78:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_platform_checks.py:84:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_platform_checks.py:94:21-32: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_platform_checks.py:100:21-32: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_platform_checks.py:113:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_platform_checks.py:119:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_platform_checks.py:128:21-32: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_platform_checks.py:134:21-32: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_platform_checks.py:147:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_platform_checks.py:153:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_platform_checks.py:162:21-32: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_platform_checks.py:168:21-32: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +""" diff --git a/conformance/results/pyrefly/directives_version_platform.toml b/conformance/results/pyrefly/directives_version_platform.toml index 562bdae49..d86833ae6 100644 --- a/conformance/results/pyrefly/directives_version_platform.toml +++ b/conformance/results/pyrefly/directives_version_platform.toml @@ -8,4 +8,7 @@ ERROR directives_version_platform.py:50:19-23: Could not find name `val6` [unkno ERROR directives_version_platform.py:59:19-23: Could not find name `val9` [unknown-name] ERROR directives_version_platform.py:66:19-24: Could not find name `val10` [unknown-name] ERROR directives_version_platform.py:75:19-24: Could not find name `val13` [unknown-name] +ERROR directives_version_platform.py:84:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_version_platform.py:96:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_version_platform.py:111:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] """ diff --git a/conformance/results/pyrefly/directives_version_platform_boolean.toml b/conformance/results/pyrefly/directives_version_platform_boolean.toml new file mode 100644 index 000000000..a44210baa --- /dev/null +++ b/conformance/results/pyrefly/directives_version_platform_boolean.toml @@ -0,0 +1,34 @@ +conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not prune branches for combinations involving implementation checks. +""" +errors_diff = """ +Line 115: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +Line 118: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +Line 120: Unexpected errors ['assert_type(int | str, int) failed [assert-type]'] +Line 123: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +Line 129: Unexpected errors ["`Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment]"] +""" +output = """ +ERROR directives_version_platform_boolean.py:17:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_version_platform_boolean.py:27:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_version_platform_boolean.py:30:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_version_platform_boolean.py:40:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_version_platform_boolean.py:50:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_version_platform_boolean.py:54:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_version_platform_boolean.py:58:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_version_platform_boolean.py:68:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_version_platform_boolean.py:73:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_version_platform_boolean.py:77:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_version_platform_boolean.py:81:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_version_platform_boolean.py:95:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_version_platform_boolean.py:110:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_version_platform_boolean.py:115:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_version_platform_boolean.py:118:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_version_platform_boolean.py:120:16-31: assert_type(int | str, int) failed [assert-type] +ERROR directives_version_platform_boolean.py:123:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_version_platform_boolean.py:125:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_version_platform_boolean.py:129:17-30: `Literal['unreachable']` is not assignable to variable `error` with type `int` [bad-assignment] +ERROR directives_version_platform_boolean.py:131:17-28: `Literal['reachable']` is not assignable to variable `error` with type `int` [bad-assignment] +""" diff --git a/conformance/results/pyright/directives_implementation_name.toml b/conformance/results/pyright/directives_implementation_name.toml new file mode 100644 index 000000000..4b3593c9d --- /dev/null +++ b/conformance/results/pyright/directives_implementation_name.toml @@ -0,0 +1,105 @@ +conformant = "Unsupported" +notes = """ +Does not prune branches for sys.implementation.name equality or membership checks. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 21: Unexpected errors ['directives_implementation_name.py:21:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 23: Unexpected errors ['directives_implementation_name.py:23:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure)'] +Line 27: Unexpected errors ['directives_implementation_name.py:27:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 32: Unexpected errors ['directives_implementation_name.py:32:17 - error: "assert_type" mismatch: expected "int" but received "str | int" (reportAssertTypeFailure)'] +Line 36: Unexpected errors ['directives_implementation_name.py:36:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 42: Unexpected errors ['directives_implementation_name.py:42:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 44: Unexpected errors ['directives_implementation_name.py:44:17 - error: "assert_type" mismatch: expected "int" but received "str | int" (reportAssertTypeFailure)'] +Line 54: Unexpected errors ['directives_implementation_name.py:54:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 56: Unexpected errors ['directives_implementation_name.py:56:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure)'] +Line 60: Unexpected errors ['directives_implementation_name.py:60:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 65: Unexpected errors ['directives_implementation_name.py:65:17 - error: "assert_type" mismatch: expected "int" but received "str | int" (reportAssertTypeFailure)'] +Line 68: Unexpected errors ['directives_implementation_name.py:68:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 74: Unexpected errors ['directives_implementation_name.py:74:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 84: Unexpected errors ['directives_implementation_name.py:84:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 86: Unexpected errors ['directives_implementation_name.py:86:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure)'] +Line 90: Unexpected errors ['directives_implementation_name.py:90:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 95: Unexpected errors ['directives_implementation_name.py:95:17 - error: "assert_type" mismatch: expected "int" but received "str | int" (reportAssertTypeFailure)'] +Line 98: Unexpected errors ['directives_implementation_name.py:98:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 104: Unexpected errors ['directives_implementation_name.py:104:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 114: Unexpected errors ['directives_implementation_name.py:114:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 116: Unexpected errors ['directives_implementation_name.py:116:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure)'] +Line 120: Unexpected errors ['directives_implementation_name.py:120:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 125: Unexpected errors ['directives_implementation_name.py:125:17 - error: "assert_type" mismatch: expected "int" but received "str | int" (reportAssertTypeFailure)'] +Line 128: Unexpected errors ['directives_implementation_name.py:128:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 134: Unexpected errors ['directives_implementation_name.py:134:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +""" +output = """ +directives_implementation_name.py:18:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:21:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:23:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure) +directives_implementation_name.py:27:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:30:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:32:17 - error: "assert_type" mismatch: expected "int" but received "str | int" (reportAssertTypeFailure) +directives_implementation_name.py:36:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:39:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:42:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:44:17 - error: "assert_type" mismatch: expected "int" but received "str | int" (reportAssertTypeFailure) +directives_implementation_name.py:51:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:54:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:56:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure) +directives_implementation_name.py:60:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:63:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:65:17 - error: "assert_type" mismatch: expected "int" but received "str | int" (reportAssertTypeFailure) +directives_implementation_name.py:68:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:70:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:72:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:74:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:81:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:84:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:86:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure) +directives_implementation_name.py:90:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:93:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:95:17 - error: "assert_type" mismatch: expected "int" but received "str | int" (reportAssertTypeFailure) +directives_implementation_name.py:98:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:100:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:102:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:104:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:111:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:114:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:116:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure) +directives_implementation_name.py:120:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:123:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:125:17 - error: "assert_type" mismatch: expected "int" but received "str | int" (reportAssertTypeFailure) +directives_implementation_name.py:128:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:130:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:132:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_name.py:134:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +""" diff --git a/conformance/results/pyright/directives_implementation_version.toml b/conformance/results/pyright/directives_implementation_version.toml new file mode 100644 index 000000000..005c16744 --- /dev/null +++ b/conformance/results/pyright/directives_implementation_version.toml @@ -0,0 +1,33 @@ +conformant = "Unsupported" +notes = """ +Does not prune branches for sys.implementation.version comparisons using the CPython target version. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 21: Unexpected errors ['directives_implementation_version.py:21:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 23: Unexpected errors ['directives_implementation_version.py:23:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure)'] +Line 27: Unexpected errors ['directives_implementation_version.py:27:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 32: Unexpected errors ['directives_implementation_version.py:32:17 - error: "assert_type" mismatch: expected "int" but received "str | int" (reportAssertTypeFailure)'] +Line 37: Unexpected errors ['directives_implementation_version.py:37:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 39: Unexpected errors ['directives_implementation_version.py:39:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +""" +output = """ +directives_implementation_version.py:18:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_version.py:21:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_version.py:23:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure) +directives_implementation_version.py:27:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_version.py:30:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_version.py:32:17 - error: "assert_type" mismatch: expected "int" but received "str | int" (reportAssertTypeFailure) +directives_implementation_version.py:35:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_version.py:37:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_version.py:39:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_implementation_version.py:41:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +""" diff --git a/conformance/results/pyright/directives_platform_checks.toml b/conformance/results/pyright/directives_platform_checks.toml new file mode 100644 index 000000000..86e80d1e4 --- /dev/null +++ b/conformance/results/pyright/directives_platform_checks.toml @@ -0,0 +1,103 @@ +conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not prune branches for startswith or tuple, set, or list membership and nonmembership checks. +""" +errors_diff = """ +Line 39: Unexpected errors ['directives_platform_checks.py:39:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 41: Unexpected errors ['directives_platform_checks.py:41:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure)'] +Line 45: Unexpected errors ['directives_platform_checks.py:45:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 50: Unexpected errors ['directives_platform_checks.py:50:17 - error: "assert_type" mismatch: expected "int" but received "str | int" (reportAssertTypeFailure)'] +Line 75: Unexpected errors ['directives_platform_checks.py:75:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 80: Unexpected errors ['directives_platform_checks.py:80:17 - error: "assert_type" mismatch: expected "int" but received "str | int" (reportAssertTypeFailure)'] +Line 87: Unexpected errors ['directives_platform_checks.py:87:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 89: Unexpected errors ['directives_platform_checks.py:89:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure)'] +Line 96: Unexpected errors ['directives_platform_checks.py:96:21 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 98: Unexpected errors ['directives_platform_checks.py:98:21 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 110: Unexpected errors ['directives_platform_checks.py:110:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 115: Unexpected errors ['directives_platform_checks.py:115:17 - error: "assert_type" mismatch: expected "int" but received "str | int" (reportAssertTypeFailure)'] +Line 122: Unexpected errors ['directives_platform_checks.py:122:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 124: Unexpected errors ['directives_platform_checks.py:124:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure)'] +Line 130: Unexpected errors ['directives_platform_checks.py:130:21 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 132: Unexpected errors ['directives_platform_checks.py:132:21 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 144: Unexpected errors ['directives_platform_checks.py:144:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 149: Unexpected errors ['directives_platform_checks.py:149:17 - error: "assert_type" mismatch: expected "int" but received "str | int" (reportAssertTypeFailure)'] +Line 156: Unexpected errors ['directives_platform_checks.py:156:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 158: Unexpected errors ['directives_platform_checks.py:158:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure)'] +Line 164: Unexpected errors ['directives_platform_checks.py:164:21 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 166: Unexpected errors ['directives_platform_checks.py:166:21 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +""" +output = """ +directives_platform_checks.py:18:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:24:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:36:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:39:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:41:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure) +directives_platform_checks.py:45:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:48:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:50:17 - error: "assert_type" mismatch: expected "int" but received "str | int" (reportAssertTypeFailure) +directives_platform_checks.py:65:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:66:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:75:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:78:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:80:17 - error: "assert_type" mismatch: expected "int" but received "str | int" (reportAssertTypeFailure) +directives_platform_checks.py:84:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:87:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:89:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure) +directives_platform_checks.py:94:21 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:96:21 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:98:21 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:100:21 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:110:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:113:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:115:17 - error: "assert_type" mismatch: expected "int" but received "str | int" (reportAssertTypeFailure) +directives_platform_checks.py:119:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:122:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:124:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure) +directives_platform_checks.py:128:21 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:130:21 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:132:21 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:134:21 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:144:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:147:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:149:17 - error: "assert_type" mismatch: expected "int" but received "str | int" (reportAssertTypeFailure) +directives_platform_checks.py:153:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:156:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:158:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure) +directives_platform_checks.py:162:21 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:164:21 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:166:21 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_platform_checks.py:168:21 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +""" diff --git a/conformance/results/pyright/directives_version_platform.toml b/conformance/results/pyright/directives_version_platform.toml index e37efb6b3..592f8be68 100644 --- a/conformance/results/pyright/directives_version_platform.toml +++ b/conformance/results/pyright/directives_version_platform.toml @@ -5,6 +5,12 @@ directives_version_platform.py:50:19 - error: "val6" is not defined (reportUndef directives_version_platform.py:59:19 - error: "val9" is not defined (reportUndefinedVariable) directives_version_platform.py:66:19 - error: "val10" is not defined (reportUndefinedVariable) directives_version_platform.py:75:19 - error: "val13" is not defined (reportUndefinedVariable) +directives_version_platform.py:84:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_version_platform.py:96:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_version_platform.py:111:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/directives_version_platform_boolean.toml b/conformance/results/pyright/directives_version_platform_boolean.toml new file mode 100644 index 000000000..aed8381cf --- /dev/null +++ b/conformance/results/pyright/directives_version_platform_boolean.toml @@ -0,0 +1,56 @@ +conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not prune branches for negated platform membership or combinations involving implementation checks. +""" +errors_diff = """ +Line 32: Unexpected errors ['directives_version_platform_boolean.py:32:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 115: Unexpected errors ['directives_version_platform_boolean.py:115:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 118: Unexpected errors ['directives_version_platform_boolean.py:118:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 120: Unexpected errors ['directives_version_platform_boolean.py:120:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure)'] +Line 123: Unexpected errors ['directives_version_platform_boolean.py:123:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +Line 129: Unexpected errors ['directives_version_platform_boolean.py:129:17 - error: Type "Literal[\\'unreachable\\']" is not assignable to declared type "int"'] +""" +output = """ +directives_version_platform_boolean.py:17:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_version_platform_boolean.py:27:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_version_platform_boolean.py:30:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_version_platform_boolean.py:32:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_version_platform_boolean.py:40:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_version_platform_boolean.py:50:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_version_platform_boolean.py:54:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_version_platform_boolean.py:58:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_version_platform_boolean.py:68:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_version_platform_boolean.py:73:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_version_platform_boolean.py:77:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_version_platform_boolean.py:81:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_version_platform_boolean.py:95:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_version_platform_boolean.py:110:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_version_platform_boolean.py:115:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_version_platform_boolean.py:118:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_version_platform_boolean.py:120:17 - error: "assert_type" mismatch: expected "int" but received "int | str" (reportAssertTypeFailure) +directives_version_platform_boolean.py:123:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_version_platform_boolean.py:125:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +directives_version_platform_boolean.py:129:17 - error: Type "Literal['unreachable']" is not assignable to declared type "int" +  "Literal['unreachable']" is not assignable to "int" (reportAssignmentType) +directives_version_platform_boolean.py:131:17 - error: Type "Literal['reachable']" is not assignable to declared type "int" +  "Literal['reachable']" is not assignable to "int" (reportAssignmentType) +""" diff --git a/conformance/results/results.html b/conformance/results/results.html index 7c89516d1..21abfed37 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -2602,6 +2602,84 @@

Python Type System Conformance Test Results

Pass Pass + + directives_implementation_name + + Unsupported +
    +
  • Does not prune branches for sys.implementation.name equality or membership checks.
  • +
+ + + Unsupported +
    +
  • Does not prune branches for sys.implementation.name equality or membership checks.
  • +
+ + + Unsupported +
    +
  • Does not prune branches for sys.implementation.name equality or membership checks.
  • +
+ + + Unsupported +
    +
  • Does not prune branches for sys.implementation.name equality or membership checks.
  • +
+ + + Unsupported +
    +
  • Does not prune branches for sys.implementation.name equality or membership checks.
  • +
+ + + Unsupported +
    +
  • Does not prune branches for sys.implementation.name equality or membership checks.
  • +
+ + + + directives_implementation_version + + Unsupported +
    +
  • Does not prune branches for sys.implementation.version comparisons using the CPython target version.
  • +
+ + + Unsupported +
    +
  • Does not prune branches for sys.implementation.version comparisons using the CPython target version.
  • +
+ + + Unsupported +
    +
  • Does not prune branches for sys.implementation.version comparisons using the CPython target version.
  • +
+ + + Unsupported +
    +
  • Does not prune branches for sys.implementation.version comparisons using the CPython target version.
  • +
+ + + Unsupported +
    +
  • Does not prune branches for sys.implementation.version comparisons using the CPython target version.
  • +
+ + + Unsupported +
    +
  • Does not prune branches for sys.implementation.version comparisons using the CPython target version.
  • +
+ + directives_no_type_check @@ -2622,6 +2700,40 @@

Python Type System Conformance Test Results

Pass Pass + + directives_platform_checks + + Partial +
    +
  • Does not prune branches for tuple, set, or list membership and nonmembership checks.
  • +
+ + + Partial +
    +
  • Does not prune branches for startswith or tuple, set, or list membership and nonmembership checks.
  • +
+ + Pass + + Partial +
    +
  • Does not prune branches for startswith or tuple, set, or list membership and nonmembership checks.
  • +
+ + + Partial +
    +
  • Does not prune branches for set or list membership and nonmembership checks; tuple checks pass.
  • +
+ + + Partial +
    +
  • Does not prune branches for tuple, set, or list membership and nonmembership checks.
  • +
+ + directives_reveal_type Pass @@ -2687,14 +2799,54 @@

Python Type System Conformance Test Results

Pass Pass + + directives_version_platform_boolean + + Partial +
    +
  • Does not prune branches for negated platform membership or combinations involving implementation checks.
  • +
+ + + Partial +
    +
  • Does not fully prune branches for and/or combinations of version and platform checks.
  • +
  • Does not prune branches for negated platform membership or combinations involving implementation checks.
  • +
+ + + Partial +
    +
  • Does not prune branches for combinations involving implementation checks.
  • +
+ + + Partial +
    +
  • Does not prune branches for negated platform membership or combinations involving implementation checks.
  • +
+ + + Partial +
    +
  • Does not prune branches for combinations involving implementation checks.
  • +
+ + + Partial +
    +
  • Does not prune branches for negated platform membership or combinations involving implementation checks.
  • +
+ + - 10 / 11 • 90.9% - 10.5 / 11 • 95.5% - 11 / 11 • 100.0% - 10 / 11 • 90.9% - 10.5 / 11 • 95.5% - 11 / 11 • 100.0% + 11 / 15 • 73.3% + 11.5 / 15 • 76.7% + 12.5 / 15 • 83.3% + 11 / 15 • 73.3% + 11.5 / 15 • 76.7% + 12 / 15 • 80.0% @@ -2732,12 +2884,12 @@

Python Type System Conformance Test Results

- 108.5 / 145 • 74.8% - 127.5 / 145 • 87.9% - 140.5 / 145 • 96.9% - 135.5 / 145 • 93.4% - 128 / 145 • 88.3% - 140 / 145 • 96.6% + 109.5 / 149 • 73.5% + 128.5 / 149 • 86.2% + 142 / 149 • 95.3% + 136.5 / 149 • 91.6% + 129 / 149 • 86.6% + 141 / 149 • 94.6% diff --git a/conformance/results/ty/directives_implementation_name.toml b/conformance/results/ty/directives_implementation_name.toml new file mode 100644 index 000000000..32c327f4f --- /dev/null +++ b/conformance/results/ty/directives_implementation_name.toml @@ -0,0 +1,74 @@ +conformant = "Unsupported" +notes = """ +Does not prune branches for sys.implementation.name equality or membership checks. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 21: Unexpected errors ['directives_implementation_name.py:21:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 23: Unexpected errors ['directives_implementation_name.py:23:5: error[type-assertion-failure] Type `int | str` does not match asserted type `int`'] +Line 27: Unexpected errors ['directives_implementation_name.py:27:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 32: Unexpected errors ['directives_implementation_name.py:32:5: error[type-assertion-failure] Type `str | int` does not match asserted type `int`'] +Line 36: Unexpected errors ['directives_implementation_name.py:36:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 42: Unexpected errors ['directives_implementation_name.py:42:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 44: Unexpected errors ['directives_implementation_name.py:44:5: error[type-assertion-failure] Type `str | int` does not match asserted type `int`'] +Line 54: Unexpected errors ['directives_implementation_name.py:54:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 56: Unexpected errors ['directives_implementation_name.py:56:5: error[type-assertion-failure] Type `int | str` does not match asserted type `int`'] +Line 60: Unexpected errors ['directives_implementation_name.py:60:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 65: Unexpected errors ['directives_implementation_name.py:65:5: error[type-assertion-failure] Type `str | int` does not match asserted type `int`'] +Line 68: Unexpected errors ['directives_implementation_name.py:68:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 74: Unexpected errors ['directives_implementation_name.py:74:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 84: Unexpected errors ['directives_implementation_name.py:84:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 86: Unexpected errors ['directives_implementation_name.py:86:5: error[type-assertion-failure] Type `int | str` does not match asserted type `int`'] +Line 90: Unexpected errors ['directives_implementation_name.py:90:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 95: Unexpected errors ['directives_implementation_name.py:95:5: error[type-assertion-failure] Type `str | int` does not match asserted type `int`'] +Line 98: Unexpected errors ['directives_implementation_name.py:98:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 104: Unexpected errors ['directives_implementation_name.py:104:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 114: Unexpected errors ['directives_implementation_name.py:114:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 116: Unexpected errors ['directives_implementation_name.py:116:5: error[type-assertion-failure] Type `int | str` does not match asserted type `int`'] +Line 120: Unexpected errors ['directives_implementation_name.py:120:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 125: Unexpected errors ['directives_implementation_name.py:125:5: error[type-assertion-failure] Type `str | int` does not match asserted type `int`'] +Line 128: Unexpected errors ['directives_implementation_name.py:128:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 134: Unexpected errors ['directives_implementation_name.py:134:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +""" +output = """ +directives_implementation_name.py:18:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_implementation_name.py:21:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_implementation_name.py:23:5: error[type-assertion-failure] Type `int | str` does not match asserted type `int` +directives_implementation_name.py:27:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_implementation_name.py:30:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_implementation_name.py:32:5: error[type-assertion-failure] Type `str | int` does not match asserted type `int` +directives_implementation_name.py:36:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_implementation_name.py:39:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_implementation_name.py:42:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_implementation_name.py:44:5: error[type-assertion-failure] Type `str | int` does not match asserted type `int` +directives_implementation_name.py:51:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_implementation_name.py:54:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_implementation_name.py:56:5: error[type-assertion-failure] Type `int | str` does not match asserted type `int` +directives_implementation_name.py:60:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_implementation_name.py:63:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_implementation_name.py:65:5: error[type-assertion-failure] Type `str | int` does not match asserted type `int` +directives_implementation_name.py:68:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_implementation_name.py:70:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_implementation_name.py:72:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_implementation_name.py:74:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_implementation_name.py:81:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_implementation_name.py:84:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_implementation_name.py:86:5: error[type-assertion-failure] Type `int | str` does not match asserted type `int` +directives_implementation_name.py:90:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_implementation_name.py:93:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_implementation_name.py:95:5: error[type-assertion-failure] Type `str | int` does not match asserted type `int` +directives_implementation_name.py:98:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_implementation_name.py:100:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_implementation_name.py:102:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_implementation_name.py:104:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_implementation_name.py:111:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_implementation_name.py:114:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_implementation_name.py:116:5: error[type-assertion-failure] Type `int | str` does not match asserted type `int` +directives_implementation_name.py:120:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_implementation_name.py:123:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_implementation_name.py:125:5: error[type-assertion-failure] Type `str | int` does not match asserted type `int` +directives_implementation_name.py:128:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_implementation_name.py:130:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_implementation_name.py:132:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_implementation_name.py:134:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +""" diff --git a/conformance/results/ty/directives_implementation_version.toml b/conformance/results/ty/directives_implementation_version.toml new file mode 100644 index 000000000..7fcbc1933 --- /dev/null +++ b/conformance/results/ty/directives_implementation_version.toml @@ -0,0 +1,25 @@ +conformant = "Unsupported" +notes = """ +Does not prune branches for sys.implementation.version comparisons using the CPython target version. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 21: Unexpected errors ['directives_implementation_version.py:21:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 23: Unexpected errors ['directives_implementation_version.py:23:5: error[type-assertion-failure] Type `int | str` does not match asserted type `int`'] +Line 27: Unexpected errors ['directives_implementation_version.py:27:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 32: Unexpected errors ['directives_implementation_version.py:32:5: error[type-assertion-failure] Type `str | int` does not match asserted type `int`'] +Line 37: Unexpected errors ['directives_implementation_version.py:37:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 39: Unexpected errors ['directives_implementation_version.py:39:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +""" +output = """ +directives_implementation_version.py:18:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_implementation_version.py:21:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_implementation_version.py:23:5: error[type-assertion-failure] Type `int | str` does not match asserted type `int` +directives_implementation_version.py:27:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_implementation_version.py:30:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_implementation_version.py:32:5: error[type-assertion-failure] Type `str | int` does not match asserted type `int` +directives_implementation_version.py:35:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_implementation_version.py:37:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_implementation_version.py:39:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_implementation_version.py:41:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +""" diff --git a/conformance/results/ty/directives_platform_checks.toml b/conformance/results/ty/directives_platform_checks.toml new file mode 100644 index 000000000..afcf243c3 --- /dev/null +++ b/conformance/results/ty/directives_platform_checks.toml @@ -0,0 +1,51 @@ +conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not prune branches for set or list membership and nonmembership checks; tuple checks pass. +""" +errors_diff = """ +Line 110: Unexpected errors ['directives_platform_checks.py:110:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 115: Unexpected errors ['directives_platform_checks.py:115:5: error[type-assertion-failure] Type `str | int` does not match asserted type `int`'] +Line 122: Unexpected errors ['directives_platform_checks.py:122:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 124: Unexpected errors ['directives_platform_checks.py:124:5: error[type-assertion-failure] Type `int | str` does not match asserted type `int`'] +Line 130: Unexpected errors ['directives_platform_checks.py:130:21: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 132: Unexpected errors ['directives_platform_checks.py:132:21: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 144: Unexpected errors ['directives_platform_checks.py:144:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 149: Unexpected errors ['directives_platform_checks.py:149:5: error[type-assertion-failure] Type `str | int` does not match asserted type `int`'] +Line 156: Unexpected errors ['directives_platform_checks.py:156:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 158: Unexpected errors ['directives_platform_checks.py:158:5: error[type-assertion-failure] Type `int | str` does not match asserted type `int`'] +Line 164: Unexpected errors ['directives_platform_checks.py:164:21: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 166: Unexpected errors ['directives_platform_checks.py:166:21: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +""" +output = """ +directives_platform_checks.py:18:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_platform_checks.py:24:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_platform_checks.py:36:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_platform_checks.py:48:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_platform_checks.py:65:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_platform_checks.py:66:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_platform_checks.py:78:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_platform_checks.py:84:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_platform_checks.py:94:21: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_platform_checks.py:100:21: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_platform_checks.py:110:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_platform_checks.py:113:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_platform_checks.py:115:5: error[type-assertion-failure] Type `str | int` does not match asserted type `int` +directives_platform_checks.py:119:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_platform_checks.py:122:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_platform_checks.py:124:5: error[type-assertion-failure] Type `int | str` does not match asserted type `int` +directives_platform_checks.py:128:21: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_platform_checks.py:130:21: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_platform_checks.py:132:21: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_platform_checks.py:134:21: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_platform_checks.py:144:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_platform_checks.py:147:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_platform_checks.py:149:5: error[type-assertion-failure] Type `str | int` does not match asserted type `int` +directives_platform_checks.py:153:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_platform_checks.py:156:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_platform_checks.py:158:5: error[type-assertion-failure] Type `int | str` does not match asserted type `int` +directives_platform_checks.py:162:21: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_platform_checks.py:164:21: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_platform_checks.py:166:21: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_platform_checks.py:168:21: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +""" diff --git a/conformance/results/ty/directives_version_platform.toml b/conformance/results/ty/directives_version_platform.toml index c74b90393..5dc18e9fc 100644 --- a/conformance/results/ty/directives_version_platform.toml +++ b/conformance/results/ty/directives_version_platform.toml @@ -7,4 +7,7 @@ directives_version_platform.py:50:19: error[unresolved-reference] Name `val6` us directives_version_platform.py:59:19: error[unresolved-reference] Name `val9` used when not defined directives_version_platform.py:66:19: error[unresolved-reference] Name `val10` used when not defined directives_version_platform.py:75:19: error[unresolved-reference] Name `val13` used when not defined +directives_version_platform.py:84:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_version_platform.py:96:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_version_platform.py:111:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` """ diff --git a/conformance/results/ty/directives_version_platform_boolean.toml b/conformance/results/ty/directives_version_platform_boolean.toml new file mode 100644 index 000000000..c27d28cab --- /dev/null +++ b/conformance/results/ty/directives_version_platform_boolean.toml @@ -0,0 +1,34 @@ +conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not prune branches for combinations involving implementation checks. +""" +errors_diff = """ +Line 115: Unexpected errors ['directives_version_platform_boolean.py:115:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 118: Unexpected errors ['directives_version_platform_boolean.py:118:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 120: Unexpected errors ['directives_version_platform_boolean.py:120:5: error[type-assertion-failure] Type `int | str` does not match asserted type `int`'] +Line 123: Unexpected errors ['directives_version_platform_boolean.py:123:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +Line 129: Unexpected errors ['directives_version_platform_boolean.py:129:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int`'] +""" +output = """ +directives_version_platform_boolean.py:17:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_version_platform_boolean.py:27:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_version_platform_boolean.py:30:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_version_platform_boolean.py:40:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_version_platform_boolean.py:50:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_version_platform_boolean.py:54:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_version_platform_boolean.py:58:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_version_platform_boolean.py:68:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_version_platform_boolean.py:73:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_version_platform_boolean.py:77:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_version_platform_boolean.py:81:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_version_platform_boolean.py:95:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_version_platform_boolean.py:110:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_version_platform_boolean.py:115:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_version_platform_boolean.py:118:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_version_platform_boolean.py:120:5: error[type-assertion-failure] Type `int | str` does not match asserted type `int` +directives_version_platform_boolean.py:123:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_version_platform_boolean.py:125:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +directives_version_platform_boolean.py:129:17: error[invalid-assignment] Object of type `Literal["unreachable"]` is not assignable to `int` +directives_version_platform_boolean.py:131:17: error[invalid-assignment] Object of type `Literal["reachable"]` is not assignable to `int` +""" diff --git a/conformance/results/zuban/directives_implementation_name.toml b/conformance/results/zuban/directives_implementation_name.toml new file mode 100644 index 000000000..97b238c2a --- /dev/null +++ b/conformance/results/zuban/directives_implementation_name.toml @@ -0,0 +1,74 @@ +conformant = "Unsupported" +notes = """ +Does not prune branches for sys.implementation.name equality or membership checks. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 21: Unexpected errors ['directives_implementation_name.py:21: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 23: Unexpected errors ['directives_implementation_name.py:23: error: Expression is of type "int | str", not "int" [misc]'] +Line 27: Unexpected errors ['directives_implementation_name.py:27: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 32: Unexpected errors ['directives_implementation_name.py:32: error: Expression is of type "str | int", not "int" [misc]'] +Line 36: Unexpected errors ['directives_implementation_name.py:36: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 42: Unexpected errors ['directives_implementation_name.py:42: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 44: Unexpected errors ['directives_implementation_name.py:44: error: Expression is of type "str | int", not "int" [misc]'] +Line 54: Unexpected errors ['directives_implementation_name.py:54: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 56: Unexpected errors ['directives_implementation_name.py:56: error: Expression is of type "int | str", not "int" [misc]'] +Line 60: Unexpected errors ['directives_implementation_name.py:60: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 65: Unexpected errors ['directives_implementation_name.py:65: error: Expression is of type "str | int", not "int" [misc]'] +Line 68: Unexpected errors ['directives_implementation_name.py:68: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 74: Unexpected errors ['directives_implementation_name.py:74: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 84: Unexpected errors ['directives_implementation_name.py:84: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 86: Unexpected errors ['directives_implementation_name.py:86: error: Expression is of type "int | str", not "int" [misc]'] +Line 90: Unexpected errors ['directives_implementation_name.py:90: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 95: Unexpected errors ['directives_implementation_name.py:95: error: Expression is of type "str | int", not "int" [misc]'] +Line 98: Unexpected errors ['directives_implementation_name.py:98: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 104: Unexpected errors ['directives_implementation_name.py:104: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 114: Unexpected errors ['directives_implementation_name.py:114: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 116: Unexpected errors ['directives_implementation_name.py:116: error: Expression is of type "int | str", not "int" [misc]'] +Line 120: Unexpected errors ['directives_implementation_name.py:120: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 125: Unexpected errors ['directives_implementation_name.py:125: error: Expression is of type "str | int", not "int" [misc]'] +Line 128: Unexpected errors ['directives_implementation_name.py:128: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 134: Unexpected errors ['directives_implementation_name.py:134: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +""" +output = """ +directives_implementation_name.py:18: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:21: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:23: error: Expression is of type "int | str", not "int" [misc] +directives_implementation_name.py:27: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:30: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:32: error: Expression is of type "str | int", not "int" [misc] +directives_implementation_name.py:36: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:39: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:42: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:44: error: Expression is of type "str | int", not "int" [misc] +directives_implementation_name.py:51: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:54: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:56: error: Expression is of type "int | str", not "int" [misc] +directives_implementation_name.py:60: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:63: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:65: error: Expression is of type "str | int", not "int" [misc] +directives_implementation_name.py:68: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:70: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:72: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:74: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:81: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:84: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:86: error: Expression is of type "int | str", not "int" [misc] +directives_implementation_name.py:90: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:93: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:95: error: Expression is of type "str | int", not "int" [misc] +directives_implementation_name.py:98: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:100: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:102: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:104: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:111: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:114: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:116: error: Expression is of type "int | str", not "int" [misc] +directives_implementation_name.py:120: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:123: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:125: error: Expression is of type "str | int", not "int" [misc] +directives_implementation_name.py:128: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:130: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:132: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_name.py:134: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +""" diff --git a/conformance/results/zuban/directives_implementation_version.toml b/conformance/results/zuban/directives_implementation_version.toml new file mode 100644 index 000000000..a6cb106ad --- /dev/null +++ b/conformance/results/zuban/directives_implementation_version.toml @@ -0,0 +1,25 @@ +conformant = "Unsupported" +notes = """ +Does not prune branches for sys.implementation.version comparisons using the CPython target version. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 21: Unexpected errors ['directives_implementation_version.py:21: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 23: Unexpected errors ['directives_implementation_version.py:23: error: Expression is of type "int | str", not "int" [misc]'] +Line 27: Unexpected errors ['directives_implementation_version.py:27: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 32: Unexpected errors ['directives_implementation_version.py:32: error: Expression is of type "str | int", not "int" [misc]'] +Line 37: Unexpected errors ['directives_implementation_version.py:37: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 39: Unexpected errors ['directives_implementation_version.py:39: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +""" +output = """ +directives_implementation_version.py:18: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_version.py:21: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_version.py:23: error: Expression is of type "int | str", not "int" [misc] +directives_implementation_version.py:27: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_version.py:30: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_version.py:32: error: Expression is of type "str | int", not "int" [misc] +directives_implementation_version.py:35: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_version.py:37: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_version.py:39: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_implementation_version.py:41: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +""" diff --git a/conformance/results/zuban/directives_platform_checks.toml b/conformance/results/zuban/directives_platform_checks.toml new file mode 100644 index 000000000..9dc84e8f0 --- /dev/null +++ b/conformance/results/zuban/directives_platform_checks.toml @@ -0,0 +1,63 @@ +conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not prune branches for tuple, set, or list membership and nonmembership checks. +""" +errors_diff = """ +Line 75: Unexpected errors ['directives_platform_checks.py:75: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 80: Unexpected errors ['directives_platform_checks.py:80: error: Expression is of type "str | int", not "int" [misc]'] +Line 87: Unexpected errors ['directives_platform_checks.py:87: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 89: Unexpected errors ['directives_platform_checks.py:89: error: Expression is of type "int | str", not "int" [misc]'] +Line 96: Unexpected errors ['directives_platform_checks.py:96: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 98: Unexpected errors ['directives_platform_checks.py:98: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 110: Unexpected errors ['directives_platform_checks.py:110: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 115: Unexpected errors ['directives_platform_checks.py:115: error: Expression is of type "str | int", not "int" [misc]'] +Line 122: Unexpected errors ['directives_platform_checks.py:122: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 124: Unexpected errors ['directives_platform_checks.py:124: error: Expression is of type "int | str", not "int" [misc]'] +Line 130: Unexpected errors ['directives_platform_checks.py:130: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 132: Unexpected errors ['directives_platform_checks.py:132: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 144: Unexpected errors ['directives_platform_checks.py:144: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 149: Unexpected errors ['directives_platform_checks.py:149: error: Expression is of type "str | int", not "int" [misc]'] +Line 156: Unexpected errors ['directives_platform_checks.py:156: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 158: Unexpected errors ['directives_platform_checks.py:158: error: Expression is of type "int | str", not "int" [misc]'] +Line 164: Unexpected errors ['directives_platform_checks.py:164: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 166: Unexpected errors ['directives_platform_checks.py:166: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +""" +output = """ +directives_platform_checks.py:18: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:24: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:36: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:48: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:65: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:66: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:75: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:78: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:80: error: Expression is of type "str | int", not "int" [misc] +directives_platform_checks.py:84: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:87: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:89: error: Expression is of type "int | str", not "int" [misc] +directives_platform_checks.py:94: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:96: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:98: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:100: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:110: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:113: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:115: error: Expression is of type "str | int", not "int" [misc] +directives_platform_checks.py:119: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:122: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:124: error: Expression is of type "int | str", not "int" [misc] +directives_platform_checks.py:128: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:130: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:132: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:134: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:144: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:147: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:149: error: Expression is of type "str | int", not "int" [misc] +directives_platform_checks.py:153: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:156: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:158: error: Expression is of type "int | str", not "int" [misc] +directives_platform_checks.py:162: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:164: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:166: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_platform_checks.py:168: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +""" diff --git a/conformance/results/zuban/directives_version_platform.toml b/conformance/results/zuban/directives_version_platform.toml index 75af449a0..9d7d66398 100644 --- a/conformance/results/zuban/directives_version_platform.toml +++ b/conformance/results/zuban/directives_version_platform.toml @@ -7,4 +7,7 @@ directives_version_platform.py:33: error: Name "val3" is not defined [name-defi directives_version_platform.py:42: error: Expression is of type "int | str", not "int" [misc] directives_version_platform.py:50: error: Name "val6" is not defined [name-defined] directives_version_platform.py:59: error: Name "val9" is not defined [name-defined] +directives_version_platform.py:84: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform.py:96: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform.py:111: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] """ diff --git a/conformance/results/zuban/directives_version_platform_boolean.toml b/conformance/results/zuban/directives_version_platform_boolean.toml new file mode 100644 index 000000000..2496f273f --- /dev/null +++ b/conformance/results/zuban/directives_version_platform_boolean.toml @@ -0,0 +1,36 @@ +conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not prune branches for negated platform membership or combinations involving implementation checks. +""" +errors_diff = """ +Line 32: Unexpected errors ['directives_version_platform_boolean.py:32: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 115: Unexpected errors ['directives_version_platform_boolean.py:115: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 118: Unexpected errors ['directives_version_platform_boolean.py:118: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 120: Unexpected errors ['directives_version_platform_boolean.py:120: error: Expression is of type "int | str", not "int" [misc]'] +Line 123: Unexpected errors ['directives_version_platform_boolean.py:123: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +Line 129: Unexpected errors ['directives_version_platform_boolean.py:129: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]'] +""" +output = """ +directives_version_platform_boolean.py:17: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:27: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:30: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:32: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:40: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:50: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:54: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:58: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:68: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:73: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:77: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:81: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:95: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:110: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:115: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:118: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:120: error: Expression is of type "int | str", not "int" [misc] +directives_version_platform_boolean.py:123: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:125: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:129: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +directives_version_platform_boolean.py:131: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] +"""