Re: [Python-Dev] an alternative suggestion, Re: pdb: should next command be extended?

2005-08-08 Thread Martin v. Löwis
Ilya Sandler wrote: > So, would implementing gdb's "until" command instead of "next N" be a > better idea? In its simplest form (without arguments) "until" advances to > the next (textually) source line... This would solve the original problem of > getting over list comprehensions... I like that

Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion

2005-08-08 Thread Martin v. Löwis
Trent Mick wrote: > One feature I like in Perforce (which Subversion doesn't have) is the > ability to have pending changesets. That sounds useful. > Currently with svn you have to manually > specify those 9 to be sure to not include the remaining one. With p4 you > just say to check-in the whole

Re: [Python-Dev] Major revision of PEP 348 committed

2005-08-08 Thread Steven Bethard
Raymond Hettinger wrote: > If the PEP can't resist the urge to create new intermediate groupings, > then start by grepping through tons of Python code to find-out which > exceptions are typically caught on the same line. That would be a > worthwhile empirical study and may lead to useful insights.

Re: [Python-Dev] Exception Reorg PEP revised yet again

2005-08-08 Thread Raymond Hettinger
[Brett Cannon] > At this point the only > changes to the hierarchy are the addition of BaseException and > TerminatingException, and the change of inheritnace for > KeyboardInterrupt, SystemExit, and NotImplementedError. TerminatingException The rationale for adding Termi

Re: [Python-Dev] Generalised String Coercion

2005-08-08 Thread Stephen J. Turnbull
> "Martin" == Martin v Löwis <[EMAIL PROTECTED]> writes: Martin> While this would work, it would still feel wrong: the Martin> binary data are *not* latin1 (most likely), so declaring Martin> them to be latin1 would be confusing. Perhaps a synonym Martin> '8bit' for latin1 coul

Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion

2005-08-08 Thread Stephen J. Turnbull
> "Donovan" == Donovan Baarda <[EMAIL PROTECTED]> writes: Donovan> It all comes down to how painless branch/merge is. Many Donovan> esoteric "features" of version control systems feel like Donovan> they are there to workaround the absence of proper Donovan> branch/merge histori

[Python-Dev] Exception Reorg PEP revised yet again

2005-08-08 Thread Brett Cannon
version 1.7 scales the proposal back once more (http://www.python.org/peps/pep-0348.html). At this point the only changes to the hierarchy are the addition of BaseException and TerminatingException, and the change of inheritnace for KeyboardInterrupt, SystemExit, and NotImplementedError. At this

Re: [Python-Dev] pdb: should next command be extended?

2005-08-08 Thread Ilya Sandler
> At OSCON, Anthony Baxter made the point that pdb is currently one of the > more unPythonic modules. What is unpythonic about pdb? Is this part of Anthony's presentation online? (Google found a summary and slides from presentation but they don't say anything about pdb's deficiencies) Ilya On M

Re: [Python-Dev] __traceback__ and reference cycles

2005-08-08 Thread Tim Peters
[Brett Cannon] > Wasn't there talk of getting rid of __del__ a little while ago and > instead use weakrefs to functions to handle cleaning up? There was from me, yes, with an eye toward P3K. > Is that still feasible? It never was, really. The combination of finalizers, cycles and resurrection i

Re: [Python-Dev] __traceback__ and reference cycles

2005-08-08 Thread Tim Peters
[Tim Peters] >> If P3K retains them [__del__]-- or maybe even before --we should >> consider taking "the Java dodge" on this one. That is, decree that >> henceforth a __del__ method will get invoked by magic at most >> once on any given object O, no matter how often O is resurrected. [Phillip J.

Re: [Python-Dev] __traceback__ and reference cycles

2005-08-08 Thread Brett Cannon
On 8/8/05, Tim Peters <[EMAIL PROTECTED]> wrote: > I can't think of a Python feature with a higher aggregate > braincell_burned / benefit ratio than __del__ methods. If P3K retains > them-- or maybe even before --we should consider taking "the Java > dodge" on this one. That is, decree that henc

Re: [Python-Dev] __traceback__ and reference cycles

2005-08-08 Thread Phillip J. Eby
At 09:12 PM 8/8/2005 -0400, Tim Peters wrote: >I can't think of a Python feature with a higher aggregate >braincell_burned / benefit ratio than __del__ methods. If P3K retains >them-- or maybe even before --we should consider taking "the Java >dodge" on this one. That is, decree that henceforth a

[Python-Dev] an alternative suggestion, Re: pdb: should next command be extended?

2005-08-08 Thread Ilya Sandler
> > Should pdb's next command accept an optional numeric argument? It would > > specify how many actual lines of code (not "line events") > > should be skipped in the current frame before stopping, > That would differ from gdb's "next ", which does "next" n times. > It would be confusing if pdb

Re: [Python-Dev] __traceback__ and reference cycles

2005-08-08 Thread Guido van Rossum
On 8/8/05, Tim Peters <[EMAIL PROTECTED]> wrote: > I can't think of a Python feature with a higher aggregate > braincell_burned / benefit ratio than __del__ methods. If P3K retains > them-- or maybe even before --we should consider taking "the Java > dodge" on this one. That is, decree that hence

Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion

2005-08-08 Thread Donovan Baarda
On Mon, 2005-08-08 at 17:51, Trent Mick wrote: [...] > [Donovan Baarda wrote] > > On Mon, 2005-08-08 at 15:49, Trent Mick wrote: [...] > You want to do checkins of code in a consisten state. Some large changes > take a couple of days to write. During which one may have to do a couple > minor things

Re: [Python-Dev] __traceback__ and reference cycles

2005-08-08 Thread Tim Peters
[Armin Rigo] > There are various proposals to add an attribute on exception instances > to store the traceback (see PEP 344). A detail not discussed, which I > thought of historical interest only, is that today's exceptions try very > hard to avoid reference cycles, in particular the cycle > > '

Re: [Python-Dev] Generalised String Coercion

2005-08-08 Thread James Y Knight
On Aug 8, 2005, at 12:14 PM, Guido van Rossum wrote: > Ouch. Too much discussion to respond to it all. Please remember that > in Jythin and IronPython, str and unicode are already synonyms. That's > how Python 3.0 will do it, except unicode will disappear as being > redundant. I like the bytes/froz

Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion

2005-08-08 Thread Trent Mick
Who made me the Perforce-bitch? Here I am screaming "Subversion! Subversion!" and y'all think I just using that as cover for a p4 lover affair. :) [Donovan Baarda wrote] > On Mon, 2005-08-08 at 15:49, Trent Mick wrote: > > One feature I like in Perforce (which Subversion doesn't have) is the > >

Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion

2005-08-08 Thread Trent Mick
[Tim Peters wrote] > [Trent Mick] > > ... > > There are other little things, like not being able to trim the check-in > > filelist when editing the check-in message. For example, say you have > > 10 files checked out scattered around the Python source tree and you > > want to check 9 of those in.

Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion

2005-08-08 Thread Donovan Baarda
On Mon, 2005-08-08 at 15:49, Trent Mick wrote: > One feature I like in Perforce (which Subversion doesn't have) is the > ability to have pending changesets. A changeset is, as with subversion, > something you check-in atomically. Pending changesets in Perforce allow > you to (1) group related files

Re: [Python-Dev] Generalised String Coercion

2005-08-08 Thread François Pinard
[Phillip J. Eby] > At 09:14 AM 8/8/2005 -0700, Guido van Rossum wrote: > > I'm not going to change my mind on text() unless someone explains > > what's so attractive about it. > 2. It's more obvious to programmers that it's a *text* string rather > than a string of bytes I've no opinion on the

Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion

2005-08-08 Thread Tim Peters
[Trent Mick] > ... > There are other little things, like not being able to trim the check-in > filelist when editing the check-in message. For example, say you have > 10 files checked out scattered around the Python source tree and you > want to check 9 of those in. This seems dubious, since you'

Re: [Python-Dev] Generalised String Coercion

2005-08-08 Thread Neil Schemenauer
On Sat, Aug 06, 2005 at 06:56:39PM -0700, Guido van Rossum wrote: > My first response to the PEP, however, is that instead of a new > built-in function, I'd rather relax the requirement that str() return > an 8-bit string -- after all, int() is allowed to return a long, so > why couldn't str() be a

Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion

2005-08-08 Thread Trent Mick
One feature I like in Perforce (which Subversion doesn't have) is the ability to have pending changesets. A changeset is, as with subversion, something you check-in atomically. Pending changesets in Perforce allow you to (1) group related files in a source tree where you might be working on multipl

Re: [Python-Dev] Generalised String Coercion

2005-08-08 Thread Martin v. Löwis
Phillip J. Eby wrote: > Actually, thinking about it some more, it seems to me it's actually more > like this: > >sock.send( ("%d:%s," % > (len(data),data.decode('latin1'))).encode('latin1') ) While this would work, it would still feel wrong: the binary data are *not* latin1 (most likely), so

Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion

2005-08-08 Thread Martin v. Löwis
Trent Mick wrote: >>No. The PEP is only about Subversion. Why should we be looking at Per >>Force? Only because Python is Open Source? > > > Perforce offers free licensing to open source projects. Ok, so I now got "it's mature", and "it would be without charges". Given that it is now running aga

Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion

2005-08-08 Thread Aahz
On Mon, Aug 08, 2005, Trent Mick wrote: >Martin: >> >> No. The PEP is only about Subversion. Why should we be looking at Per >> Force? Only because Python is Open Source? > > Perforce offers free licensing to open source projects. So did BitKeeper. Linux got bitten by that. We'd need a strong

[Python-Dev] PEP-343 - Context Managment variant

2005-08-08 Thread falcon
I know I came after the battle. And I have just another sight on context managment. Simple Context Managment may look in Python 2.4.1 like this: Synhronized example: def Synhronised(lock,func): lock.acquire() try: func() finally: lock.rele

Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion

2005-08-08 Thread Trent Mick
[Aahz wrote] > On Sun, Aug 07, 2005, Barry Warsaw wrote: > > > > We'd also have to teach the current crop of developers how to use the > > client tools effectively. I think it's fairly simple to teach a CVS > > user how to use Subversion, but have no idea if translating CVS > > experience to Perfo

Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion

2005-08-08 Thread Trent Mick
> > Since Python is Open Source are you looking at Per Force which you can > > use for free and seems to be a happy medium between something like CVS > > and something horrific like Clear Case? > > No. The PEP is only about Subversion. Why should we be looking at Per > Force? Only because Python i

Re: [Python-Dev] PEP 347: Migration to Subversion

2005-08-08 Thread Brett Cannon
On 8/7/05, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Brett Cannon wrote: > > What is going in under python/ ? If it is what is currently > > /dist/src/, then great and the renaming of the repository works. > > Just have a look yourself :-) Yes, this is dist/src. > Ah, OK. I didn't drill f

Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion

2005-08-08 Thread Aahz
On Sun, Aug 07, 2005, Barry Warsaw wrote: > > We'd also have to teach the current crop of developers how to use the > client tools effectively. I think it's fairly simple to teach a CVS > user how to use Subversion, but have no idea if translating CVS > experience to Perforce is as straightforward

Re: [Python-Dev] Generalised String Coercion

2005-08-08 Thread M.-A. Lemburg
Guido van Rossum wrote: > Ouch. Too much discussion to respond to it all. Please remember that > in Jythin and IronPython, str and unicode are already synonyms. I know, but don't understand that argument: aren't we talking about Python in general, not some particular implementation ? Why should

Re: [Python-Dev] Generalised String Coercion

2005-08-08 Thread Phillip J. Eby
At 09:14 AM 8/8/2005 -0700, Guido van Rossum wrote: >I'm not going to change my mind on text() unless >someone explains what's so attractive about it. 1. It's obvious to non-programmers what it's for (str and unicode aren't) 2. It's more obvious to programmers that it's a *text* string rather tha

Re: [Python-Dev] __traceback__ and reference cycles

2005-08-08 Thread Guido van Rossum
On 8/8/05, Armin Rigo <[EMAIL PROTECTED]> wrote: > Attaching a __traceback__ will only make this "bug" show up more often, > as the 'except Exception, e' line in a __del__() method would be enough > to trigger it. Hmm... We can blame this on __del__ as much as on __traceback__, of course... But it

Re: [Python-Dev] Generalised String Coercion

2005-08-08 Thread Guido van Rossum
Ouch. Too much discussion to respond to it all. Please remember that in Jythin and IronPython, str and unicode are already synonyms. That's how Python 3.0 will do it, except unicode will disappear as being redundant. I like the bytes/frozenbytes pair idea. Streams could grow a getpos()/setpos() API

Re: [Python-Dev] pdb: should next command be extended?

2005-08-08 Thread Aahz
On Sun, Aug 07, 2005, Ilya Sandler wrote: > > Solution: > > Should pdb's next command accept an optional numeric argument? It would > specify how many actual lines of code (not "line events") > should be skipped in the current frame before stopping, At OSCON, Anthony Baxter made the point that p

Re: [Python-Dev] Generalised String Coercion

2005-08-08 Thread Aahz
On Sun, Aug 07, 2005, Neil Schemenauer wrote: > On Sat, Aug 06, 2005 at 06:56:39PM -0700, Guido van Rossum wrote: >> >> My first response to the PEP, however, is that instead of a new >> built-in function, I'd rather relax the requirement that str() return >> an 8-bit string > > Do you have any th

Re: [Python-Dev] Generalised String Coercion

2005-08-08 Thread Phillip J. Eby
At 10:07 AM 8/8/2005 +0200, Martin v. Löwis wrote: >Phillip J. Eby wrote: > >>Hm. What would be the use case for using %s with binary, non-text data? > > > > > > Well, I could see using it to write things like netstrings, > > i.e. sock.send("%d:%s," % (len(data),data)) seems like the One Obvious

Re: [Python-Dev] Generalised String Coercion

2005-08-08 Thread M.-A. Lemburg
Michael Hudson wrote: > "M.-A. Lemburg" <[EMAIL PROTECTED]> writes: > > >>Set the external encoding for stdin, stdout, stderr: >> >>(also an example for adding encoding support to an >>existing file object): >> >>def set_sys_std_encoding(encodin

Re: [Python-Dev] Generalised String Coercion

2005-08-08 Thread M.-A. Lemburg
Guido van Rossum wrote: > [Guido] > >>>My first response to the PEP, however, is that instead of a new >>>built-in function, I'd rather relax the requirement that str() return >>>an 8-bit string -- after all, int() is allowed to return a long, so >>>why couldn't str() be allowed to return a Unicod

Re: [Python-Dev] Generalised String Coercion

2005-08-08 Thread Nick Coghlan
Martin v. Löwis wrote: > Guido van Rossum wrote: >>The bytes type could just be a very thin wrapper around array('b'). > > That answers an important question: so you want the bytes type to be > mutable (and, consequently, unsuitable as a dictionary key). I would suggest a bytes/frozenbytes pair,

Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion

2005-08-08 Thread Michael Hudson
Barry Warsaw <[EMAIL PROTECTED]> writes: > Unfortunately, I don't think "we" (meaning specifically the collective > python.org admins) have much if any operational experience with > Perforce. Also (from someone who is on the fringes of the pydotorg admin set): I don't know that much about subvers

Re: [Python-Dev] Generalised String Coercion

2005-08-08 Thread Michael Hudson
"M.-A. Lemburg" <[EMAIL PROTECTED]> writes: > Set the external encoding for stdin, stdout, stderr: > > (also an example for adding encoding support to an > existing file object): > > def set_sys_std_encoding(encoding): > # Load encoding supp

Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion

2005-08-08 Thread Oleg Broytmann
On Sun, Aug 07, 2005 at 11:51:49PM -0400, Barry Warsaw wrote: > Has anyone experienced svn corruptions with the fsfs backend? I > haven't, across quite a few repositories. I haven't. But I must admit that the repositories I'm working with aren't big. The bigest is at svn.colorstudy.com (I am w

Re: [Python-Dev] __traceback__ and reference cycles

2005-08-08 Thread Armin Rigo
Hi, On Mon, Aug 08, 2005 at 10:31:06AM +0200, Armin Rigo wrote: > see the attached program... Oups. Here it is... Armin import sys, time def log(typ, val, tb): pass class X: def __del__(self): try: typo except Exception, e: e_type, e_value, e_t

[Python-Dev] __traceback__ and reference cycles

2005-08-08 Thread Armin Rigo
Hi all, There are various proposals to add an attribute on exception instances to store the traceback (see PEP 344). A detail not discussed, which I thought of historical interest only, is that today's exceptions try very hard to avoid reference cycles, in particular the cycle 'frame -> local

Re: [Python-Dev] Generalised String Coercion

2005-08-08 Thread Martin v. Löwis
Stephen J. Turnbull wrote: > If you mean the UTF-8 support in Terminal, it's no better or worse > than the EUC-JP support. The problem is that most Japanese Unix > systems continue to default to EUC-JP, and many Windows hosts > (including Samba file systems) default to Shift JIS. So people using

Re: [Python-Dev] Generalised String Coercion

2005-08-08 Thread Stephen J. Turnbull
> "Martin" == Martin v Löwis <[EMAIL PROTECTED]> writes: Martin> I think your doubts are unfounded. Many Japanese people Martin> change it to EUC-JP (I believe), as UTF-8 support doesn't Martin> work well for them (or atleast didn't use to). If you mean the UTF-8 support in Termin

Re: [Python-Dev] Generalised String Coercion

2005-08-08 Thread Martin v. Löwis
Phillip J. Eby wrote: >>Hm. What would be the use case for using %s with binary, non-text data? > > > Well, I could see using it to write things like netstrings, > i.e. sock.send("%d:%s," % (len(data),data)) seems like the One Obvious Way > to write a netstring in today's Python at least. But

Re: [Python-Dev] Generalised String Coercion

2005-08-08 Thread Martin v. Löwis
Guido van Rossum wrote: > We might be able to get there halfway in Python 2.x: we could > introduce the bytes type now, and provide separate APIs to read and > write them. (In fact, the array module and the f.readinto() method > make this possible today, but it's too klunky so nobody uses it. > Pe

Re: [Python-Dev] Generalised String Coercion

2005-08-08 Thread Martin v. Löwis
Bob Ippolito wrote: > It's UTF-8 by default, I highly doubt many people bother to change it. I think your doubts are unfounded. Many Japanese people change it to EUC-JP (I believe), as UTF-8 support doesn't work well for them (or atleast didn't use to). Regards, Martin ___

Re: [Python-Dev] [C++-sig] GCC version compatibility

2005-08-08 Thread Christoph Ludwig
On Sun, Aug 07, 2005 at 11:11:56PM +0200, "Martin v. Löwis" wrote: > I've looked at the patch, and it looks fairly safe, so I committed it. Thanks. I did not forget my promise to look into a more comprehensive approach to the C++ build issues. But I first need to better understand the potential im