Re: [Python-3000] revamping the io stack, part 2

2006-05-04 Thread Marcin 'Qrczak' Kowalczyk
"tomer filiba" <[EMAIL PROTECTED]> writes: > read(x) guarantees to return x bytes, or EOFError otherwise > (and also restoing the stream position). This is a poor choice of the fundamental operation. For example when recoding bytes to characters, an analogous interface for a character stream is i

Re: [Python-3000] Types Sig Archive Broken Links?

2006-05-04 Thread Bill Birch
On Thu, 4 May 2006 05:05 pm, Birch, Bill wrote: > The Types-SIG archives link > (http://mail.python.org/pipermail/types-sig/) gives a 404 error. > > Does anyone know how to get the archive back? Had no idea that email to mailman would end up here! Anyhow, I found another copy of the archive here:

Re: [Python-3000] characters data type

2006-05-04 Thread Tristan Seligmann
* Talin <[EMAIL PROTECTED]> [2006-05-02 22:20:51 +]: > Although if you are supporting surrogates, then __getitem__ and __getslice__ > won't be O(1), will they? That's why I asked about UCS-2, which is what I Unfortunately, if Python is compiled with 16-bit storage for unicode characters, then

Re: [Python-3000] PEP 3102 Open Issues

2006-05-04 Thread Guido van Rossum
On 5/3/06, Talin <[EMAIL PROTECTED]> wrote: > 1) Drop this portion of the proposal > 2) Go with the 'naked star' syntax anyway over the objections, and > explain the rationale in the docs; > 3) Come up with a separator character we can agree on > 4) Come up with a brilliantly-devised alternative T

Re: [Python-3000] bug in modulus?

2006-05-04 Thread Tim Peters
[Guido] > This is way above my head. :-) Of course it's not, but the issues are subtle and messy enough that it's a burden to make sufficient time for them. I'm sympathetic to that ;-) > The only requirement *I* would like to see is that for floats that > exactly represent ints (or longs for tha

Re: [Python-3000] characters data type

2006-05-04 Thread Josiah Carlson
Josiah Carlson <[EMAIL PROTECTED]> wrote: > Good point. Making the input 1025 bytes, and performing block[:-1] > resulted in a running time of 13.94 seconds. I just thought of a better way of benchmarking list-like over-allocation semantics. For assumed smaller-sized writes: Use an array, and

Re: [Python-3000] bug in modulus?

2006-05-04 Thread Guido van Rossum
On 5/3/06, Tim Peters <[EMAIL PROTECTED]> wrote: > I'd be happiest if P3K floats didn't support __mod__ or __divmod__ at > all. Floating mod is so rare it doesn't need syntactic support, and > the try-to-be-like-integer __mod__ and __divmod__ floats support now > can deliver surprises to all users

Re: [Python-3000] characters data type

2006-05-04 Thread Fredrik Lundh
Josiah Carlson wrote: > I just thought of a better way of benchmarking list-like over-allocation > semantics. here's another way: $ more Objects/unicodeobject.c ... PyObject * PyUnicode_Join(PyObject *separator, PyObject *seq) { size_t res_alloc = 100; /* # allocated bytes for string in res

[Python-3000] in-out parameters

2006-05-04 Thread Rudy Rudolph
Guido wrote:>Does Java have them? I know very little Java, but all the other object-oriented languages I use support in-out and out parameters. For example:C++:void foo(int ¶m) {param += 5;}void bar(int ¶m) {param = 10;}// C++ does not distinguish between in-out and out parameters.

Re: [Python-3000] characters data type

2006-05-04 Thread Guido van Rossum
Can you please post the benchmarking code? On 5/4/06, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > Josiah Carlson <[EMAIL PROTECTED]> wrote: > > Good point. Making the input 1025 bytes, and performing block[:-1] > > resulted in a running time of 13.94 seconds. > > I just thought of a better way

Re: [Python-3000] in-out parameters

2006-05-04 Thread Jim Jewett
On 5/4/06, Rudy Rudolph <[EMAIL PROTECTED]> wrote: // C++ does not distinguish between in-out and out parameters.// call themint x = 2; foo(x); // x is now 7 It is important to avoid this obfuscation.C's &addr is slightly better, but still pretty error prone with collections, like a string

Re: [Python-3000] in-out parameters

2006-05-04 Thread Michael Chermside
[Rudy Rudolph writes to propose adding in-out parameters in Py3K] Rudy: Special offer, good this week only! If you send me a sample piece of code using in-out parameters written in any language I can understand, I will provide (free of charge!) a translation into highly readable idiomatic Python

Re: [Python-3000] bug in modulus?

2006-05-04 Thread Marcin 'Qrczak' Kowalczyk
"Tim Peters" <[EMAIL PROTECTED]> writes: > If Python switched to C99's definition of % for both integers and > floats, that would work out better so far as it goes. But Python's % > makes much more sense for integers, so that would be a flea on the > tail of the dog wagging the guy walking the do

Re: [Python-3000] characters data type

2006-05-04 Thread Josiah Carlson
"Guido van Rossum" <[EMAIL PROTECTED]> wrote: > Can you please post the benchmarking code? No problem. - Josiah import time import array block = 1025*'\0' block2 = array.array("B", 1024*[0]) desired_size = 16*1024*1024 incrs = [] for mns in (1024, 0): y = [] x = 1024 while x <

Re: [Python-3000] PEP 3102 Open Issues

2006-05-04 Thread Greg Ewing
Talin wrote: > I have to admit that while the reasoning behind the use of the > '*' character is logical, the logic seems a little convoluted. Part of this > is due to the use of negative logic - the absence of something > that would normally be there (i.e. a keyword after the '*') indicates > a r