Re: [Python-3000] Move argv[0]? (Re: Unicode and OS strings)

2007-09-17 Thread Steven Bethard
On 9/17/07, Ron Adam <[EMAIL PROTECTED]> wrote: > Greg Ewing wrote: > > Thomas Wouters wrote: > >> If you want to put more meaning in the argv list, use an option > >> parser. > > > > I want to put *less* meaning in it, not more. :-) > > And using an argument parser is often overkill for > > simple

Re: [Python-3000] Unicode and OS strings

2007-09-17 Thread Stephen J. Turnbull
> "Marcin 'Qrczak' Kowalczyk" <[EMAIL PROTECTED]> writes: >> When a codec encounters something it can't handle, whether it's a >> valid character in a legacy encoding, a private use character in a >> UTF, or an invalid sequence of code units, it throws an exception >> specifying the charac

Re: [Python-3000] Unicode and OS strings

2007-09-17 Thread Stephen J. Turnbull
> "Marcin 'Qrczak' Kowalczyk" <[EMAIL PROTECTED]> writes: >> > Well, for any scheme which attempts to modify UTF-8 by accepting >> > arbitrary byte strings is used, *something* must be interpreted >> > differently than in real UTF-8. >> Wrong. In my scheme everything ends up in the PUA

Re: [Python-3000] Move argv[0]? (Re: Unicode and OS strings)

2007-09-17 Thread Ron Adam
Greg Ewing wrote: > Ron Adam wrote: >> Would it be possible to split out the (pre) parsing from optparse so >> that instead of returning a list > > Whatever is done, anything putting itself forward as a light > duty argument parser has to have a *very* simple API. Neither > of the current ones

Re: [Python-3000] Immutable bytes -- looking for volunteer

2007-09-17 Thread Talin
Guido van Rossum wrote: > This may have passed in a thread where no-one was listening, so I'm > repeating it here. > > I'm considering the following option: bytes would always be immutable, > and for the few places (mostly in io.py) where a mutable bytes buffer > would be handy, we use the array m

Re: [Python-3000] Stackless anyone ?

2007-09-17 Thread Talin
Terry Reedy wrote: > "Sascha Peilicke" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | is or has there been any discussion about stackless and py3k? > > No. C. Tismer has focused his current efforts on PyPy. That seems like the right strategy to me. Rather than focusing on a

[Python-3000] Immutable bytes -- looking for volunteer

2007-09-17 Thread Guido van Rossum
This may have passed in a thread where no-one was listening, so I'm repeating it here. I'm considering the following option: bytes would always be immutable, and for the few places (mostly in io.py) where a mutable bytes buffer would be handy, we use the array module. Then it would also make sense

Re: [Python-3000] bytes & Py_TPFLAGS_BASETYPE

2007-09-17 Thread Guido van Rossum
On 9/17/07, Greg Ewing <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > I understand. But bytes are still in flux (see the repeated requests > > for immutable bytes) > > Moreover, my feeling is that immutable byte should be > the *default*, and if you want mutable bytes you > should have to

Re: [Python-3000] bytes & Py_TPFLAGS_BASETYPE

2007-09-17 Thread Greg Ewing
Guido van Rossum wrote: > I understand. But bytes are still in flux (see the repeated requests > for immutable bytes) Moreover, my feeling is that immutable byte should be the *default*, and if you want mutable bytes you should have to ask for it. This would make bytes more symmetrical with strin

Re: [Python-3000] Move argv[0]? (Re: Unicode and OS strings)

2007-09-17 Thread Greg Ewing
Ron Adam wrote: > Would it be possible to split out the (pre) parsing from optparse so > that instead of returning a list Whatever is done, anything putting itself forward as a light duty argument parser has to have a *very* simple API. Neither of the current ones fits my brain, and I have to go

Re: [Python-3000] bytes & Py_TPFLAGS_BASETYPE

2007-09-17 Thread Greg Ewing
Guido van Rossum wrote: > AFAIK there's nothing stopping you from subclassing in C. That may be true -- I may have just incorrectly assumed that the flag would prevent subclassing from working properly in C as well. > I thought we were talking about Python though. That may be true as well. I thi

Re: [Python-3000] Unicode and OS strings

2007-09-17 Thread Mike Klaas
On 16-Sep-07, at 4:03 PM, Greg Ewing wrote: > Paul Moore wrote: >> On 15/09/2007, Gregory P. Smith <[EMAIL PROTECTED]> wrote: >> >>> similarly for the environment. os.environ dict >>> should be bytes object keys and values >> >> You can't have bytes as keys - the type isn't hashable... > > Has th

Re: [Python-3000] Unicode and OS strings

2007-09-17 Thread Marcin 'Qrczak' Kowalczyk
Dnia 16-09-2007, N o godzinie 16:13 +0900, Stephen J. Turnbull napisał(a): > When a codec encounters something it can't handle, whether it's a > valid character in a legacy encoding, a private use character in a > UTF, or an invalid sequence of code units, it throws an exception > specifying the c

Re: [Python-3000] Unicode and OS strings

2007-09-17 Thread Martin v. Löwis
> Yes. I'm recovering from moving from Japan to California, and will be > busy until the beginning of October, I'll get started on it then. For > this kind of thing, what is the deadline for submission of a patch? > Before the alpha, early beta? Either would work fine, unless somebody else does

Re: [Python-3000] Unicode and OS strings

2007-09-17 Thread Marcin 'Qrczak' Kowalczyk
Dnia 15-09-2007, So o godzinie 09:13 +0900, Stephen J. Turnbull napisał(a): > > Well, for any scheme which attempts to modify UTF-8 by accepting > > arbitrary byte strings is used, *something* must be interpreted > > differently than in real UTF-8. > > Wrong. In my scheme everything ends up i

Re: [Python-3000] bytes & Py_TPFLAGS_BASETYPE

2007-09-17 Thread Guido van Rossum
I understand. But bytes are still in flux (see the repeated requests for immutable bytes) and I don't want to commit to anything just yet. On 9/17/07, Mathieu Fenniak <[EMAIL PROTECTED]> wrote: > On 17-Sep-07, at 11:53 AM, Guido van Rossum wrote: > >> "writeToStream" method that serializes the obj

Re: [Python-3000] bytes & Py_TPFLAGS_BASETYPE

2007-09-17 Thread Mathieu Fenniak
On 17-Sep-07, at 11:53 AM, Guido van Rossum wrote: >> "writeToStream" method that serializes the object -- a byte string >> would write out <68656c6c6f>, a text string (hello), and so on for >> other more complex types (dictionaries, labels, arrays, PDF data >> streams). The type is also responsib

Re: [Python-3000] bytes & Py_TPFLAGS_BASETYPE

2007-09-17 Thread Terry Reedy
"Mathieu Fenniak" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | method (for pickling subclass instances). I was going to upload this | to the SF patch manager, but it appears to be closed to permit only | project members access. Because SF is only an archive now. We are now usin

Re: [Python-3000] bytes & Py_TPFLAGS_BASETYPE

2007-09-17 Thread Guido van Rossum
On 9/17/07, Mathieu Fenniak <[EMAIL PROTECTED]> wrote: > On 17-Sep-07, at 9:00 AM, Guido van Rossum wrote: > > Maybe I should apologize for pushing back so hard, but in my > > experience most people who subclass a built-in type do it because they > > can, not because they should -- the lamented "pa

Re: [Python-3000] bytes & Py_TPFLAGS_BASETYPE

2007-09-17 Thread Mathieu Fenniak
On 17-Sep-07, at 9:00 AM, Guido van Rossum wrote: Maybe I should apologize for pushing back so hard, but in my experience most people who subclass a built-in type do it because they can, not because they should -- the lamented "path" module being a prime example in my view. I'm still not convinc

Re: [Python-3000] Move argv[0]? (Re: Unicode and OS strings)

2007-09-17 Thread Ron Adam
Greg Ewing wrote: > Thomas Wouters wrote: >> If you want to put more meaning in the argv list, use an option >> parser. > > I want to put *less* meaning in it, not more. :-) > And using an argument parser is often overkill for > simple programs. Would it be possible to split out the (pre) pars

Re: [Python-3000] bytes & Py_TPFLAGS_BASETYPE

2007-09-17 Thread Guido van Rossum
On 9/16/07, Mathieu Fenniak <[EMAIL PROTECTED]> wrote: > On 16-Sep-07, at 7:56 PM, Guido van Rossum wrote: > > So suppose my answer was "no, bytes won't be subclassable". How much > > would you really lose by having to wrap a separate object around a > > bytes object, rather than being able to subc

Re: [Python-3000] bytes & Py_TPFLAGS_BASETYPE

2007-09-17 Thread Guido van Rossum
On 9/16/07, Greg Ewing <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > It is possible to compromise the integrity of a built-in type by > > subclassing it if the type wasn't carefully written to expect > > subclassing. > > Disallowing subclassing in Python may make sense, but > it seems un