IDLE 3 and PEP414 - highlighting unicode literals #59163
Copy link
Copy link
Closed
Labels
Description
| BPO | 14958 |
|---|---|
| Nosy | @ned-deily, @serwy |
| Files |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = None
closed_at = <Date 2012-05-30.06:04:39.544>
created_at = <Date 2012-05-30.00:37:47.983>
labels = ['easy', 'expert-IDLE', 'type-bug']
title = 'IDLE 3 and PEP414 - highlighting unicode literals'
updated_at = <Date 2012-12-31.23:07:55.082>
user = 'https://github.com/serwy'bugs.python.org fields:
activity = <Date 2012-12-31.23:07:55.082>
actor = 'python-dev'
assignee = 'none'
closed = True
closed_date = <Date 2012-05-30.06:04:39.544>
closer = 'ned.deily'
components = ['IDLE']
creation = <Date 2012-05-30.00:37:47.983>
creator = 'roger.serwy'
dependencies = []
files = ['25778']
hgrepos = []
issue_num = 14958
keywords = ['patch', 'easy']
message_count = 7.0
messages = ['161921', '161927', '161928', '161929', '161930', '162046', '178718']
nosy_count = 3.0
nosy_names = ['ned.deily', 'roger.serwy', 'python-dev']
pr_nums = []
priority = 'low'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue14958'
versions = ['Python 2.7', 'Python 3.3']Reactions are currently unavailable
Activity
serwy commentedon May 30, 2012
bpo-8641 addressed the problem of not highlighting byte literals, but dropped Unicode literals, as it should have. This happened months before the acceptance of PEP-414.
IDLE 3 should now highlight u"" as well as b"", as well as valid combinations with r"".
python-dev commentedon May 30, 2012
New changeset 94a5bf416e50 by Ned Deily in branch 'default':
Issue bpo-14958: Change IDLE systax highlighting to recognize all string and
http://hg.python.org/cpython/rev/94a5bf416e50
ned-deily commentedon May 30, 2012
It turns out that the previous and current versions of IDLE syntax highlighting did not recognize literals with valid two-character prefixes, like "ur" or "br". Besides restoring "ur", 3.3 also added "rb" to the existing "br" prefixes. The applied patch explicitly matches any of the prefixes documented in the 3.3 language reference:
http://docs.python.org/dev/reference/lexical_analysis.html#string-and-bytes-literals
serwy commentedon May 30, 2012
Should the patch be partially back-ported to 2.7 as well given that IDLE 2 doesn't highlight two-character prefixes?
ned-deily commentedon May 30, 2012
It could be. But perhaps its absence will be another incentive to move to Python 3.3.
serwy commentedon Jun 1, 2012
Attached is a backport to 2.7.
python-dev commentedon Dec 31, 2012
New changeset 0dbdb85fd141 by Ned Deily in branch '2.7':
Issue bpo-14958: backport to 2.7.x from 3.3 (patch by Roger Serwy)
http://hg.python.org/cpython/rev/0dbdb85fd141