[Python-ideas] Maybe allow br"" or rb"" e.g., for bytes regexes in Py3?

Mark Summerfield mark at qtrac.eu
Tue Jun 29 14:34:57 CEST 2010


You're right, so I've raised it as a doc bug:
http://bugs.python.org/issue9114

On 2010-06-29, Nick Coghlan wrote:
> On Tue, Jun 29, 2010 at 6:20 PM, Mark Summerfield <mark at qtrac.eu> wrote:
> >    FONTNAME_RE = re.compile(br"/FontName\s+/(\S+)")
> >    # or
> >    FONTNAME_RE = re.compile(rb"/FontName\s+/(\S+)")
> > 
> > I _slightly_ prefer rb"" to br"" but either would be great:-)
> 
> According to my local build, we already picked 'br':
> 
> Python 3.2a0 (py3k:81943, Jun 12 2010, 22:02:56)
> [GCC 4.4.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> 
> >>> "\t"
> 
> '\t'
> 
> >>> r"\t"
> 
> '\\t'
> 
> >>> b"\t"
> 
> b'\t'
> 
> >>> br"\t"
> 
> b'\\t'
> 
> I installed the system python3 to confirm that this isn't new:
> 
> Python 3.1.2 (r312:79147, Apr 15 2010, 15:35:48)
> [GCC 4.4.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> 
> >>> br"\t"
> 
> b'\\t'
> 
> Cheers,
> Nick.


-- 
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
    C++, Python, Qt, PyQt - training and consultancy
        "Advanced Qt Programming" - ISBN 0321635906
            http://www.qtrac.eu/aqpbook.html

                I ordered a Dell netbook with Ubuntu...
       I got no OS, no apology, no solution, & no refund (so far)
               http://www.qtrac.eu/dont-buy-dell.html



More information about the Python-ideas mailing list