From: Terry Jan Reedy Date: Sun, 5 Jul 2026 01:56:20 +0000 (-0400) Subject: Add "new in 3.15" comments to idlelib (#153052) X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=0621639e8fc0084af15550651198c9e221b6619d;p=thirdparty%2FPython%2Fcpython.git Add "new in 3.15" comments to idlelib (#153052) Lazy keyword added to colorizer and test in PR-#142351. Tested NameError hint expanded in PR-#144299. --- diff --git a/Lib/idlelib/colorizer.py b/Lib/idlelib/colorizer.py index 6db38de3aa6c..ac12d8ace357 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 4d9e6bd887c5..8a6ab527f938 100644 --- a/Lib/idlelib/idle_test/test_colorizer.py +++ b/Lib/idlelib/idle_test/test_colorizer.py @@ -542,7 +542,7 @@ class ColorDelegatorTest(unittest.TestCase): 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 57bf5559c0fa..f35c3168a446 100644 --- a/Lib/idlelib/idle_test/test_run.py +++ b/Lib/idlelib/idle_test/test_run.py @@ -44,7 +44,7 @@ class ExceptionTest(unittest.TestCase): "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