[Python-3000] PyBytes_FromObject

2008-06-28 Thread Benjamin Peterson
It seems PyBytes is missing the parallel call for PyByteArray_FromObject. Should I add it? -- Cheers, Benjamin Peterson "There's no place like 127.0.0.1." ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python

Re: [Python-3000] PyBytes_FromObject

2008-06-28 Thread Guido van Rossum
Seems to make sense. Do you see many places where it would make existing code shorter? On Sat, Jun 28, 2008 at 6:46 AM, Benjamin Peterson <[EMAIL PROTECTED]> wrote: > It seems PyBytes is missing the parallel call for > PyByteArray_FromObject. Should I add it? -- --Guido van Rossum (home page: ht

Re: [Python-3000] PyBytes_FromObject

2008-06-28 Thread Benjamin Peterson
On Sat, Jun 28, 2008 at 10:33 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > Seems to make sense. Do you see many places where it would make > existing code shorter? It's a good way to convert a bytearray to bytes. -- Cheers, Benjamin Peterson "There's no place like 127.0.0.1." _

Re: [Python-3000] PyBytes_FromObject

2008-06-28 Thread Guido van Rossum
On Sat, Jun 28, 2008 at 8:47 AM, Benjamin Peterson <[EMAIL PROTECTED]> wrote: > On Sat, Jun 28, 2008 at 10:33 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: >> Seems to make sense. Do you see many places where it would make >> existing code shorter? > > It's a good way to convert a bytearray to by

Re: [Python-3000] PyBytes_FromObject

2008-06-28 Thread Brett Cannon
On Sat, Jun 28, 2008 at 8:33 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > Seems to make sense. Do you see many places where it would make > existing code shorter? > If it could be used to get the bytes from a file object, then marshal.c could use it; the code calls the "read" method on file o

[Python-3000] Regular expressions, py3k and unicode

2008-06-28 Thread Antoine Pitrou
Hello, Several posters (including a certain GvR) in the bug tracker (*) have been baffled by an apparent bug where the re.IGNORECASE flag didn't imply case-insensitivity for non-ASCII characters. It turns out that, although the pattern was a string object and although Py3k is supposed to be unicod

Re: [Python-3000] PyBytes_FromObject

2008-06-28 Thread Guido van Rossum
On Sat, Jun 28, 2008 at 11:30 AM, Brett Cannon <[EMAIL PROTECTED]> wrote: > On Sat, Jun 28, 2008 at 8:33 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: >> Seems to make sense. Do you see many places where it would make >> existing code shorter? > If it could be used to get the bytes from a file o

Re: [Python-3000] PyBytes_FromObject

2008-06-28 Thread Benjamin Peterson
On Sat, Jun 28, 2008 at 11:38 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On Sat, Jun 28, 2008 at 8:47 AM, Benjamin Peterson > <[EMAIL PROTECTED]> wrote: >> On Sat, Jun 28, 2008 at 10:33 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: >>> Seems to make sense. Do you see many places where it w

Re: [Python-3000] Regular expressions, py3k and unicode

2008-06-28 Thread Guido van Rossum
On Sat, Jun 28, 2008 at 1:45 PM, Antoine Pitrou <[EMAIL PROTECTED]> wrote: > Several posters (including a certain GvR) in the bug tracker (*) have been > baffled by an apparent bug where the re.IGNORECASE flag didn't imply > case-insensitivity for non-ASCII characters. It turns out that, although t

Re: [Python-3000] Regular expressions, py3k and unicode

2008-06-28 Thread Terry Reedy
Guido van Rossum wrote: On Sat, Jun 28, 2008 at 1:45 PM, Antoine Pitrou <[EMAIL PROTECTED]> wrote: Several posters (including a certain GvR) in the bug tracker (*) have been baffled by an apparent bug where the re.IGNORECASE flag didn't imply case-insensitivity for non-ASCII characters. It tur

Re: [Python-3000] Regular expressions, py3k and unicode

2008-06-28 Thread Nick Coghlan
Terry Reedy wrote: Guido van Rossum wrote: On Sat, Jun 28, 2008 at 1:45 PM, Antoine Pitrou <[EMAIL PROTECTED]> wrote: Wouldn't it be more natural that, at least when the pattern is a str object rather a bytes object, the re.UNICODE be implied by default? +1 Would there be any reason (I d