Commit 40e95dfc authored by Raymond Hettinger's avatar Raymond Hettinger

Issue #21029: IDLE now colors print consistently as a keyword.

parent 3708349c
...@@ -16,6 +16,9 @@ def make_pat(): ...@@ -16,6 +16,9 @@ def make_pat():
kw = r"\b" + any("KEYWORD", keyword.kwlist) + r"\b" kw = r"\b" + any("KEYWORD", keyword.kwlist) + r"\b"
builtinlist = [str(name) for name in dir(__builtin__) builtinlist = [str(name) for name in dir(__builtin__)
if not name.startswith('_')] if not name.startswith('_')]
# We don't know whether "print" is a function or a keyword,
# so we always treat is as a keyword (the most common case).
builtinlist.remove('print')
# self.file = file("file") : # self.file = file("file") :
# 1st 'file' colorized normal, 2nd as builtin, 3rd as string # 1st 'file' colorized normal, 2nd as builtin, 3rd as string
builtin = r"([^.'\"\\#]\b|^)" + any("BUILTIN", builtinlist) + r"\b" builtin = r"([^.'\"\\#]\b|^)" + any("BUILTIN", builtinlist) + r"\b"
......
...@@ -265,6 +265,10 @@ IDLE ...@@ -265,6 +265,10 @@ IDLE
- Issue #20406: Use Python application icons for Idle window title bars. - Issue #20406: Use Python application icons for Idle window title bars.
Patch mostly by Serhiy Storchaka. Patch mostly by Serhiy Storchaka.
- Issue #21029: Occurrences of "print" are now consistently colored as
being a keyword (the colorizer doesn't know if print functions are
enabled in the source).
- Issue #17721: Remove non-functional configuration dialog help button until we - Issue #17721: Remove non-functional configuration dialog help button until we
make it actually gives some help when clicked. Patch by Guilherme Simões. make it actually gives some help when clicked. Patch by Guilherme Simões.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment