This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年06月17日 12:17 by ncoghlan, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue15096-1.patch | christian.heimes, 2012年06月17日 12:58 | review | ||
| issue15096-2.patch | christian.heimes, 2012年06月19日 21:43 | review | ||
| Messages (8) | |||
|---|---|---|---|
| msg163062 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2012年06月17日 12:17 | |
When PEP 414 restored support for explicit Unicode literals in Python 3, the "ur" string prefix was deemed to be a synonym for the "r" prefix. However, "ur" in 2.x was only kinda-sorta-raw, since it still supported Unicode escapes: $ python Python 2.7.3 (default, Apr 30 2012, 21:18:11) [GCC 4.7.0 20120416 (Red Hat 4.7.0-2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> print(ur'\u03B3') γ By contrast, they really are raw strings in 3.x, because the default UTF-8 source code encoding allows arbitrary Unicode characters to be included directly in the literal: $ ./python Python 3.3.0a4+ (default:cfbf6aa5c9e3+, Jun 17 2012, 15:25:45) [GCC 4.7.0 20120507 (Red Hat 4.7.0-5)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> r"γ" 'γ' >>> "\U000003B3" 'γ' >>> r"\U000003B3" '\\U000003B3' >>> ur"\U000003B3" '\\U000003B3' Rather than reintroducing this weird legacy not-really-raw string behaviour, I'd prefer to revert this aspect of the PEP 414 changes completely. |
|||
| msg163067 - (view) | Author: Christian Heimes (christian.heimes) * (Python committer) | Date: 2012年06月17日 12:58 | |
+1 Raw unicode strings are rarely used and it's easy to overcome the limitation. I've created a patch that disabled ur'' syntax, updates the docs and adds some tests for u'' syntax. I couldn't find any tests for the syntax ... shame on you! :) |
|||
| msg163078 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2012年06月17日 16:36 | |
> I've created a patch that disabled ur'' syntax, updates the docs and adds some tests for u'' syntax. Don't forget tokenize module (see issue15054). |
|||
| msg163214 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2012年06月19日 20:17 | |
If you commit this, please do so before beta1. |
|||
| msg163221 - (view) | Author: Christian Heimes (christian.heimes) * (Python committer) | Date: 2012年06月19日 20:52 | |
I'll submit an updated patch tomorrow. |
|||
| msg163223 - (view) | Author: Christian Heimes (christian.heimes) * (Python committer) | Date: 2012年06月19日 21:43 | |
New patch: * corrected comment in Parser/tokenizer.c * added test for ub"" and bu"" raising SyntaxError * removed handling of ur"" from tokenize module Serhiy, could you please review my changed to the tokenize module? I think I found all relevant places but I'm not absolutely sure. |
|||
| msg163263 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年06月20日 09:18 | |
New changeset 8e47e9af826e by Christian Heimes in branch 'default': Issue #15096: Drop support for the ur string prefix http://hg.python.org/cpython/rev/8e47e9af826e |
|||
| msg163264 - (view) | Author: Christian Heimes (christian.heimes) * (Python committer) | Date: 2012年06月20日 09:24 | |
Thanks for you review, Serhiy. I removed the last remains from test_tokenize and even found another missing sentence in the docs. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:31 | admin | set | github: 59301 |
| 2014年09月02日 20:59:57 | r.david.murray | link | issue22328 superseder |
| 2012年06月20日 09:24:48 | christian.heimes | set | status: open -> closed resolution: fixed messages: + msg163264 stage: patch review -> resolved |
| 2012年06月20日 09:18:14 | python-dev | set | nosy:
+ python-dev messages: + msg163263 |
| 2012年06月19日 21:43:43 | christian.heimes | set | keywords:
+ needs review files: + issue15096-2.patch messages: + msg163223 stage: needs patch -> patch review |
| 2012年06月19日 20:52:39 | christian.heimes | set | assignee: christian.heimes messages: + msg163221 |
| 2012年06月19日 20:17:14 | georg.brandl | set | nosy:
+ georg.brandl messages: + msg163214 |
| 2012年06月19日 16:19:25 | vinay.sajip | link | issue14973 superseder |
| 2012年06月18日 19:24:30 | Arfrever | set | nosy:
+ Arfrever |
| 2012年06月17日 16:36:03 | serhiy.storchaka | set | messages: + msg163078 |
| 2012年06月17日 16:20:34 | flox | set | nosy:
+ vinay.sajip |
| 2012年06月17日 16:16:16 | flox | set | nosy:
+ aronacher, flox |
| 2012年06月17日 12:58:52 | christian.heimes | set | files:
+ issue15096-1.patch nosy: + christian.heimes messages: + msg163067 keywords: + patch |
| 2012年06月17日 12:30:41 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka |
| 2012年06月17日 12:20:29 | ezio.melotti | set | nosy:
+ ezio.melotti |
| 2012年06月17日 12:18:03 | ncoghlan | set | priority: normal -> release blocker |
| 2012年06月17日 12:17:38 | ncoghlan | create | |