From b4a156b3cc39d5c7c0864e5f42f25ad08658372b Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Sat, 4 Jul 2026 20:50:30 -0400 Subject: [PATCH] Add "new in 3.15" comments to idlelib Lazy keyword added to colorizer and test in PR-#142351. Tested NameError hint expanded in PR-#144299. --- Lib/idlelib/colorizer.py | 2 +- Lib/idlelib/idle_test/test_colorizer.py | 2 +- Lib/idlelib/idle_test/test_run.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/idlelib/colorizer.py b/Lib/idlelib/colorizer.py index 6db38de3aa6cb9c..ac12d8ace3575f3 100644 --- a/Lib/idlelib/colorizer.py +++ b/Lib/idlelib/colorizer.py @@ -42,7 +42,7 @@ def make_pat(): ]) + r"))" ) - lazy_softkw = ( + lazy_softkw = ( # lazy new in 3.15 (+ 2 lines below). r"^[ \t]*" + # at beginning of line + possible indentation r"(?Plazy)" + r"(?=[ \t]+(?:import|from)\b)" # followed by 'import' or 'from' diff --git a/Lib/idlelib/idle_test/test_colorizer.py b/Lib/idlelib/idle_test/test_colorizer.py index 4d9e6bd887c5b87..8a6ab527f9387f4 100644 --- a/Lib/idlelib/idle_test/test_colorizer.py +++ b/Lib/idlelib/idle_test/test_colorizer.py @@ -542,7 +542,7 @@ def test_case_soft_keyword(self): self._assert_highlighting('case _:', {'KEYWORD': [('1.0', '1.4'), ('1.5', '1.6')]}) - def test_lazy_soft_keyword(self): + def test_lazy_soft_keyword(self): # lazy new in 3.15. # lazy followed by import self._assert_highlighting('lazy import foo', {'KEYWORD': [('1.0', '1.4'), diff --git a/Lib/idlelib/idle_test/test_run.py b/Lib/idlelib/idle_test/test_run.py index 57bf5559c0fa88a..f35c3168a446fef 100644 --- a/Lib/idlelib/idle_test/test_run.py +++ b/Lib/idlelib/idle_test/test_run.py @@ -44,7 +44,7 @@ def __eq__(self, other): "Or did you forget to import 'abc'?\n"), ('int.reel', AttributeError, "type object 'int' has no attribute 'reel'. " - "Did you mean '.real' instead of '.reel'?\n"), + "Did you mean '.real' instead of '.reel'?\n"), # More in 3.15. ) @force_not_colorized