classification
Title: Allow rb"" literals as an equivalent to br""
Type: enhancement Stage: commit review
Components: Interpreter Core Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: barry, benjamin.peterson, georg.brandl, gvanrossum, ncoghlan, pitrou, python-dev
Priority: normal Keywords: patch

Created on 2012-01-09 19:14 by pitrou, last changed 2012-01-12 21:48 by pitrou. This issue is now closed.

Files
File name Uploaded Description Edit
rb.patch pitrou, 2012-01-09 19:14 review
rb2.patch pitrou, 2012-01-09 19:27 review
Messages (8)
msg150964 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-01-09 19:14
As mentioned in issue13744, it is not easy to remember that br"" is an allowed bytes literal but not rb"". Here is a patch to allow both forms.
msg150967 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-01-09 19:27
Updated patch with doc.
msg150974 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2012-01-09 20:09
On Jan 09, 2012, at 07:27 PM, Antoine Pitrou wrote:

>Updated patch with doc.

Nicely done.  +1
msg150978 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2012-01-09 20:53
I would be happier if there was precedent for this with "ur" = "ru" in 2.x, which is not true.
msg150979 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-01-09 20:57
> I would be happier if there was precedent for this with "ur" = "ru" in
> 2.x, which is not true.

In my experience, raw unicode literals were very rare while raw bytes
literals are quite frequent (mainly for regular expressions).
msg151038 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2012-01-11 08:01
+1 for "raw bytes", which reads much nicer to me than "bytes raw".
msg151153 - (view) Author: Roundup Robot (python-dev) Date: 2012-01-12 21:47
New changeset bbed36370b08 by Antoine Pitrou in branch 'default':
Issue #13748: Raw bytes literals can now be written with the `rb` prefix as well as `br`.
http://hg.python.org/cpython/rev/bbed36370b08
msg151154 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-01-12 21:48
Committed, thanks.
History
Date User Action Args
2012-01-12 21:48:47pitrousetstatus: open -> closed
resolution: fixed
messages: + msg151154

stage: patch review -> commit review
2012-01-12 21:47:54python-devsetnosy: + python-dev
messages: + msg151153
2012-01-11 08:01:02georg.brandlsetnosy: + georg.brandl
messages: + msg151038
2012-01-09 20:57:49pitrousetmessages: + msg150979
2012-01-09 20:53:34benjamin.petersonsetmessages: + msg150978
2012-01-09 20:09:40barrysetmessages: + msg150974
2012-01-09 19:27:37pitrousetfiles: + rb2.patch

messages: + msg150967
2012-01-09 19:14:10pitroucreate