From 202d944e9ee43da15f4694303337036f14c2ac90 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 6 Jul 2026 19:45:52 -0400 Subject: [PATCH] conformance: annotate module protocol globals The module protocol test should exercise structural compatibility without prescribing how type checkers infer unannotated module globals. Give the mutable attributes explicit public types so their protocol compatibility is unambiguous. --- conformance/results/ty/protocols_modules.toml | 2 -- conformance/tests/_protocols_modules1.py | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/conformance/results/ty/protocols_modules.toml b/conformance/results/ty/protocols_modules.toml index ff470754f..86ede3609 100644 --- a/conformance/results/ty/protocols_modules.toml +++ b/conformance/results/ty/protocols_modules.toml @@ -4,11 +4,9 @@ notes = """ Never considers a module as satisfying a protocol with a method member due to the fact that the method will never exist on the class `types.ModuleType`, only on a given specific module instance. """ errors_diff = """ -Line 25: Unexpected errors ["protocols_modules.py:25:17: error[invalid-assignment] Object of type `` is not assignable to `Options1`"] Line 47: Unexpected errors ["protocols_modules.py:47:18: error[invalid-assignment] Object of type `` is not assignable to `Reporter1`"] """ output = """ -protocols_modules.py:25:17: error[invalid-assignment] Object of type `` is not assignable to `Options1` protocols_modules.py:26:17: error[invalid-assignment] Object of type `` is not assignable to `Options2` protocols_modules.py:47:18: error[invalid-assignment] Object of type `` is not assignable to `Reporter1` protocols_modules.py:48:18: error[invalid-assignment] Object of type `` is not assignable to `Reporter2` diff --git a/conformance/tests/_protocols_modules1.py b/conformance/tests/_protocols_modules1.py index 14e4bdd57..ed8a55ed2 100644 --- a/conformance/tests/_protocols_modules1.py +++ b/conformance/tests/_protocols_modules1.py @@ -2,6 +2,6 @@ Support file for protocols_modules.py test. """ -timeout = 100 -one_flag = True -other_flag = False +timeout: int = 100 +one_flag: bool = True +other_flag: bool = False