Re: [Python-3000] have zip() raise exception for sequences of different lengths

2006-09-05 Thread Giovanni Bajo
Raymond Hettinger wrote: > It's a PITA because it precludes all of the use cases whether the > inputs ARE intentionally of different length (like when one argument > supplys an infinite iterator): > >for lineno, ts, line in zip(count(1), timestamp(), sys.stdin): >print 'Line %d, Time %

Re: [Python-3000] locale-aware strings ?

2006-09-05 Thread Paul Prescod
On 9/4/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: In this particular case I don't care what's simpler to implement, butwhat's most likely to do what the user expects. If on a particular boxmost files are encoded in encoding X, and the user did whatever isnecessary to tell the tools that that's

Re: [Python-3000] locale-aware strings ?

2006-09-05 Thread Jim Jewett
On 9/5/06, Paul Prescod <[EMAIL PROTECTED]> wrote: > On 9/4/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > In this particular case I don't care what's simpler to implement, but > > what's most likely to do what the user expects. Good. > But now Europeans are just as likely to use UTF-8 as a

Re: [Python-3000] locale-aware strings ?

2006-09-05 Thread Guido van Rossum
On 9/5/06, Paul Prescod <[EMAIL PROTECTED]> wrote: > Beyond all of that: It just seems wrong to me that I could send someone a > bunch of files and a Python program and their results processing them would > be different from mine, despite the fact that we run the same version of > Python on the sam

Re: [Python-3000] have zip() raise exception for sequences of different lengths

2006-09-05 Thread Georg Brandl
Giovanni Bajo wrote: > Raymond Hettinger wrote: > >> It's a PITA because it precludes all of the use cases whether the >> inputs ARE intentionally of different length (like when one argument >> supplys an infinite iterator): >> >>for lineno, ts, line in zip(count(1), timestamp(), sys.stdin): >

Re: [Python-3000] locale-aware strings ?

2006-09-05 Thread Brian Quinlan
Guido van Rossum wrote: > And it seems just as wrong if Python doesn't do what the user expects. > If I were a beginning Python user, I'd hate it if I had prepared a > simple data file in vi or notepad and my Python program wouldn't read > it right because Python's idea of encoding differs from my

Re: [Python-3000] locale-aware strings ?

2006-09-05 Thread Guido van Rossum
On 9/5/06, Brian Quinlan <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > And it seems just as wrong if Python doesn't do what the user expects. > > If I were a beginning Python user, I'd hate it if I had prepared a > > simple data file in vi or notepad and my Python program wouldn't read >

Re: [Python-3000] locale-aware strings ?

2006-09-05 Thread Paul Prescod
On 9/5/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: On 9/5/06, Paul Prescod <[EMAIL PROTECTED]> wrote:> Beyond all of that: It just seems wrong to me that I could send someone a> bunch of files and a Python program and their results processing them would > be different from mine, despite the fac

Re: [Python-3000] locale-aware strings ?

2006-09-05 Thread Paul Prescod
On 9/5/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > So, for me and users> like me, Python is going to silently misinterpret my data.Not to any greater extent than Notepad or whatever other tool you are using.Yes. Unicode was invented in large part because people got sick of crappy tools that s

Re: [Python-3000] locale-aware strings ?

2006-09-05 Thread Guido van Rossum
I have no desire to continue this discussion in every detail. I believe we've both made our point, eloquently enough. The designers of the I/O library will have to come up with the specific rules for deciding on the default encoding. The only thing I'm saying is that hardcoding the default encoding

Re: [Python-3000] long/int unification

2006-09-05 Thread Travis Oliphant
[EMAIL PROTECTED] wrote: > Here is a quick status of the int_unification branch, > summarizing what I did at the Google sprint in NYC. > > - the int type has been dropped; the builtins int and long > now both refer to long type > - all PyInt_* API is forwarded to the PyLong_* API. Little > cha

Re: [Python-3000] long/int unification

2006-09-05 Thread Guido van Rossum
On 9/5/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > What impact is this long/int unification going to have on C-based > sub-types of the old int-type? Will you be able to sub-class the > integer-type in C without carrying around all the extra backage of the > Python long? This seems unlikely

Re: [Python-3000] long/int unification

2006-09-05 Thread Guido van Rossum
On 9/5/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > > On 9/5/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > > > >> What impact is this long/int unification going to have on C-based > >> sub-types of the old int-type? Will you be able to sub-class the > >> integer-

Re: [Python-3000] long/int unification

2006-09-05 Thread Travis Oliphant
Guido van Rossum wrote: > On 9/5/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > >> What impact is this long/int unification going to have on C-based >> sub-types of the old int-type? Will you be able to sub-class the >> integer-type in C without carrying around all the extra backage of the >> P

Re: [Python-3000] locale-aware strings ?

2006-09-05 Thread David Hopwood
Guido van Rossum wrote: > On 9/5/06, Paul Prescod <[EMAIL PROTECTED]> wrote: > >> Beyond all of that: It just seems wrong to me that I could send someone a >> bunch of files and a Python program and their results processing them >> would be different from mine, despite the fact that we run the sam

Re: [Python-3000] locale-aware strings ?

2006-09-05 Thread David Hopwood
David Hopwood wrote: > I don't know about vi, but notepad will open and save files that are not in > the system ("ANSI") encoding just fine. On opening it checks for a BOM and > auto-detects UTF-8 and UTF-16; on saving it will write a BOM if you choose > "Unicode" (UTF-16LE), "Unicode big-endian" (

Re: [Python-3000] locale-aware strings ?

2006-09-05 Thread Guido van Rossum
On 9/5/06, David Hopwood <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > On 9/5/06, Paul Prescod <[EMAIL PROTECTED]> wrote: > > > >> Beyond all of that: It just seems wrong to me that I could send someone a > >> bunch of files and a Python program and their results processing them > >> wou

Re: [Python-3000] locale-aware strings ?

2006-09-05 Thread David Hopwood
Guido van Rossum wrote: > On 9/5/06, Brian Quinlan <[EMAIL PROTECTED]> wrote: > [...] > > That would not be doing what the user wants. We have extensive > experience with defaulting to ASCII in Python 2.x and it's mostly bad. > There should definitely be a way to force ASCII as the default > encod

Re: [Python-3000] encoding hell

2006-09-05 Thread Guido van Rossum
On 9/4/06, Oleg Broytmann <[EMAIL PROTECTED]> wrote: > On Sun, Sep 03, 2006 at 01:45:28PM -0700, Aahz wrote: > > On Sun, Sep 03, 2006, Marcin 'Qrczak' Kowalczyk wrote: > > > "tomer filiba" <[EMAIL PROTECTED]> writes: > > >> > > >> file("foo", "w+") ? > > > > > > What is a rationale of this operatio

Re: [Python-3000] locale-aware strings ?

2006-09-05 Thread David Hopwood
Guido van Rossum wrote: > On 9/5/06, David Hopwood <[EMAIL PROTECTED]> wrote: >> Guido van Rossum wrote: >> > On 9/5/06, Paul Prescod <[EMAIL PROTECTED]> wrote: >> > >> >> Beyond all of that: It just seems wrong to me that I could send >> >> someone a bunch of files and a Python program and their r

Re: [Python-3000] locale-aware strings ?

2006-09-05 Thread Paul Prescod
On 9/5/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: On 9/5/06, David Hopwood <[EMAIL PROTECTED]> wrote:> Guido van Rossum wrote:> > On 9/5/06, Paul Prescod < [EMAIL PROTECTED]> wrote:> >> >> Beyond all of that: It just seems wrong to me that I could send someone a> >> bunch of files and a Python

Re: [Python-3000] locale-aware strings ?

2006-09-05 Thread Paul Prescod
On 9/5/06, David Hopwood <[EMAIL PROTECTED]> wrote: Guido van Rossum wrote:> On 9/5/06, Brian Quinlan <[EMAIL PROTECTED]> wrote:> [...]>> That would not be doing what the user wants. We have extensive > experience with defaulting to ASCII in Python 2.x and it's mostly bad.> There should definitely

Re: [Python-3000] locale-aware strings ?

2006-09-05 Thread David Hopwood
Paul Prescod wrote: > On 9/5/06, David Hopwood <[EMAIL PROTECTED]> wrote: >> Guido van Rossum wrote: >> > On 9/5/06, Brian Quinlan <[EMAIL PROTECTED]> wrote: >> > [...] >> > >> > That would not be doing what the user wants. We have extensive >> > experience with defaulting to ASCII in Python 2.x an

Re: [Python-3000] locale-aware strings ?

2006-09-05 Thread Marcin 'Qrczak' Kowalczyk
David Hopwood <[EMAIL PROTECTED]> writes: > The whole idea of a default encoding is flawed. Ideally there would be > no default; programmers should be forced to think about the issue > on a case-by-case basis. In some cases they might choose to open a file > with the system encoding, but that shou