mirror of
https://github.com/python/cpython.git
synced 2026-07-08 03:00:00 -04:00
[3.15] Add "new in 3.15" comments to idlelib (GH-153052) (#153054)
Add "new in 3.15" comments to idlelib (GH-153052)
Lazy keyword added to colorizer and test in PR-GH-142351.
Tested NameError hint expanded in PR-GH-144299.
(cherry picked from commit 0621639e8f)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
This commit is contained in:
committed by
GitHub
parent
41a2abe06d
commit
7eb476dfbe
@@ -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"(?P<LAZY_SOFTKW>lazy)" +
|
||||
r"(?=[ \t]+(?:import|from)\b)" # followed by 'import' or 'from'
|
||||
|
||||
@@ -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'),
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user