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

2007-09-25 Thread Brett Cannon
On 9/25/07, Greg Ewing <[EMAIL PROTECTED]> wrote: > Brett Cannon wrote: > > Return a byte. If you want a mutable length-1 thing you should have > > to do a length 1 slice. Otherwise its an index operation and you want > > what is stored at the index, which is an immutable byte. > > Why shouldn't

Re: [Python-3000] ordered dict for p3k collections?

2007-09-25 Thread Mike Klaas
On 25-Sep-07, at 2:01 PM, Mark Summerfield wrote: > On 2007-09-25, Guido wrote: >> >> For that to happen, someone has to write a production-quality >> implementation, release it as a separate 3rd party module for a >> while, >> show that it is sufficiently stable and popular to be incorporated i

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

2007-09-25 Thread Greg Ewing
Brett Cannon wrote: > Return a byte. If you want a mutable length-1 thing you should have > to do a length 1 slice. Otherwise its an index operation and you want > what is stored at the index, which is an immutable byte. Why shouldn't this argument apply to immutable bytes objects as well? Or sh

Re: [Python-3000] New io system and binary data

2007-09-25 Thread skip
Charles> There's another place in the tutorial section Charles> http://docs.python.org/dev/3.0/tutorial/inputoutput.html and Charles> search for "On Windows and the Macintosh, 'b' appended to the Charles> mode opens the file in binary mode," I fixed that up as well. I mentioned t

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

2007-09-25 Thread Greg Ewing
Paul Moore wrote: > The array module is built in, so it's > written in C - what needs to be exposed to qualify as a "C API"? I think he's referring to the fact that there is no public array.h header file provided that lays out the C-level details. In fact, last time I looked I don't think there wa

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

2007-09-25 Thread Brett Cannon
On 9/25/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 9/25/07, Brett Cannon <[EMAIL PROTECTED]> wrote: > > On 9/25/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > OK, Jeffrey's and Adam's patches were helpful; it looks like the > > > damage done by making bytes immutable is pretty limi

Re: [Python-3000] New io system and binary data

2007-09-25 Thread Greg Ewing
Bill Janssen wrote: > Now that we've moved away from the C stdio model, and the distinction > between text and binary streams is meaningful even on POSIX systems, > perhaps we should also change those names to reflect that difference > from C. I don't think anything would be gained by changing the

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

2007-09-25 Thread Guido van Rossum
On 9/25/07, Brett Cannon <[EMAIL PROTECTED]> wrote: > On 9/25/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > OK, Jeffrey's and Adam's patches were helpful; it looks like the > > damage done by making bytes immutable is pretty limited: plenty of > > modules are affected, but the changes are str

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

2007-09-25 Thread Brett Cannon
On 9/25/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > OK, Jeffrey's and Adam's patches were helpful; it looks like the > damage done by making bytes immutable is pretty limited: plenty of > modules are affected, but the changes are straightforward and > localized. > > So now I have an idea that

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

2007-09-25 Thread Jim Jewett
> How about we take the existing PyString implementation (Python 2's > str, currently still present as str8 in py3k), remove the locale and > unicode mixing support, and call it bytes. Is that just encode/decode? But isn't this one sensible way to store an encoded str, so that decode (only) would

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

2007-09-25 Thread Guido van Rossum
On 9/25/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > OK, Jeffrey's and Adam's patches were helpful; it looks like the > damage done by making bytes immutable is pretty limited: plenty of > modules are affected, but the changes are straightforward and > localized. > > So now I have an idea that

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

2007-09-25 Thread Guido van Rossum
OK, Jeffrey's and Adam's patches were helpful; it looks like the damage done by making bytes immutable is pretty limited: plenty of modules are affected, but the changes are straightforward and localized. So now I have an idea that goes a little farther. It relates to Talin's response (second mess

Re: [Python-3000] ordered dict for p3k collections?

2007-09-25 Thread Mark Summerfield
On 2007-09-25, you wrote: > On 9/25/07, Mark Summerfield <[EMAIL PROTECTED]> wrote: > > My proposal was for the sorteddict to be put in the collections module, > > not as a builtin. One of the things I particularly like about Python is > > that the core language is small. > > > > However, I think t

Re: [Python-3000] ordered dict for p3k collections?

2007-09-25 Thread Guido van Rossum
On 9/25/07, Mark Summerfield <[EMAIL PROTECTED]> wrote: > My proposal was for the sorteddict to be put in the collections module, > not as a builtin. One of the things I particularly like about Python is > that the core language is small. > > However, I think that the collections module is rather t

Re: [Python-3000] ordered dict for p3k collections?

2007-09-25 Thread Mark Summerfield
On 2007-09-25, Guido van Rossum wrote: > On 9/25/07, Mark Summerfield <[EMAIL PROTECTED]> wrote: > > I can understand your personal preference for dict, although mine is for > > sorteddict---but IMO Python should provide both since both are > > legitimate in appropriate contexts. > > Careful what y

Re: [Python-3000] ordered dict for p3k collections?

2007-09-25 Thread Rob Crowther
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Tue, 25 Sep 2007 10:18:50 -0700 "Guido van Rossum" <[EMAIL PROTECTED]> wrote: > On 9/25/07, Mark Summerfield <[EMAIL PROTECTED]> wrote: > > I can understand your personal preference for dict, although mine is for > > sorteddict---but IMO Python sho

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

2007-09-25 Thread Guido van Rossum
On 9/24/07, Jeffrey Yasskin <[EMAIL PROTECTED]> wrote: > On 9/20/07, Adam Hupp <[EMAIL PROTECTED]> wrote: > > On 9/20/07, Jeffrey Yasskin <[EMAIL PROTECTED]> wrote: > > > > > > Thanks for the help! This brings up a policy question: For patches > > > like the one I've attached here, do we want to st

Re: [Python-3000] ordered dict for p3k collections?

2007-09-25 Thread Guido van Rossum
On 9/25/07, Mark Summerfield <[EMAIL PROTECTED]> wrote: > I can understand your personal preference for dict, although mine is for > sorteddict---but IMO Python should provide both since both are > legitimate in appropriate contexts. Careful what you wish for. One of Python's strengths is that th

Re: [Python-3000] New io system and binary data

2007-09-25 Thread Guido van Rossum
On 9/25/07, Uche Ogbuji <[EMAIL PROTECTED]> wrote: > Bill Janssen wrote: > > That's certainly the prescribed behavior for the C stdio streams on > > POSIX-compliant systems. I think a lot of the original design of the > > Python I/O system was based on that C stdio system, including names > > like

Re: [Python-3000] Extension: mpf for GNU MP floating point

2007-09-25 Thread Facundo Batista
2007/9/25, Rob Crowther <[EMAIL PROTECTED]>: > a float. At this point, I'm able to use it as a stripped down drop in > replacement for Decimal. It's also much, much faster. Didn't understand this phrase. You're able to use it, after stripping it down, as a replacement of Decimal? Or you're able t

Re: [Python-3000] New io system and binary data

2007-09-25 Thread Uche Ogbuji
Bill Janssen wrote: > That's certainly the prescribed behavior for the C stdio streams on > POSIX-compliant systems. I think a lot of the original design of the > Python I/O system was based on that C stdio system, including names > like stdin, stdout, and stderr. > > Now that we've moved away fro

Re: [Python-3000] Extension: mpf for GNU MP floating point

2007-09-25 Thread Rob Crowther
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I've uploaded the latest code to http://umass.glexia.net/mpf.tar.bz2 It's been cleaned up, implements a little bit of the abstract number interface, many very repetitive function declarations were turned into macros making it far easier to maintain,

Re: [Python-3000] ordered dict for p3k collections?

2007-09-25 Thread Mark Summerfield
On 2007-09-16, Arvind Singh wrote: > > How do you get from "some keys can't be ordered" to "it doesn't make > > sense for Python to have sorteddict or sortedset"? If you want to use > > keys that can't be ordered, then feel free to continue to use dict. > > For situations in which ordering is impo

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

2007-09-25 Thread Paul Moore
On 22/09/2007, Travis Oliphant <[EMAIL PROTECTED]> wrote: > If it is decided to make bytes immutable (which sounds good to me), > then I want to add my voice to those that clamor for an additional > mutable object capable of allocating chunks of memory. > > This object should have a C-API and have