Re: [Python-Dev] On quote styles

2008-05-12 Thread David Borowitz
Python itself doesn't appear to follow that principle: >>> "Ain't nothin' stoppin' this from usin' \"double quotes\"." 'Ain\'t nothin\' stoppin\' this from usin\' "double quotes".' IMHO it's a useful rule of thumb, but like most of the other alternatives presented in this thread, taken to extremes

Re: [Python-Dev] On quote styles

2008-05-12 Thread skip
> "Benji" == Benji York <[EMAIL PROTECTED]> writes: Benji> One such entry could be "Do what python does.": >>> 'I am a string.' 'I am a string.' >>> "I'm a string" "I'm a string" That would be the principle of fewest backslashes. ;-) Skip

Re: [Python-Dev] Adding start to enumerate()

2008-05-12 Thread Terry Reedy
"Nick Coghlan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I'd like to hear from Raymond before we do this. I'm pretty sure we had | a reason for *not* doing it that way in when enumerate() was added, but | I can't remember what that reason might have been... http://bugs.python

Re: [Python-Dev] Adding start to enumerate()

2008-05-12 Thread Nick Coghlan
Georg Brandl wrote: I believe the following is a common use-case for enumerate() (at least, I've used it quite some times): for lineno, line in enumerate(fileobject): ... For this, it would be nice to have a start parameter for enumerate(). The changes are minimal -- okay for 2.6? I'd lik

Re: [Python-Dev] On quote styles

2008-05-12 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On May 12, 2008, at 5:16 PM, Benji York wrote: On Sat, May 10, 2008 at 10:51 PM, <[EMAIL PROTECTED]> wrote: It might be useful to have a wiki page which identified some of the conventions people use. One such entry could be "Do what python does

Re: [Python-Dev] On quote styles

2008-05-12 Thread Benji York
On Sat, May 10, 2008 at 10:51 PM, <[EMAIL PROTECTED]> wrote: > It might be useful to have a wiki page which identified some of the > conventions people use. One such entry could be "Do what python does.": >>> 'I am a string.' 'I am a string.' >>> "I'm a string" "I'm a string" -- Benji York _

Re: [Python-Dev] lib2to3, need some light on the imports fixer

2008-05-12 Thread Collin Winter
On Mon, May 12, 2008 at 1:58 PM, Guilherme Polo <[EMAIL PROTECTED]> wrote: > Hello, > > Would someone tell me how can I add a new entry in the MAPPING dict in > the lib2to3/fixes/fix_imports.py that does the following: > > "import A" gets fixed as "import C.D as A" > > Right now it is fixing by

[Python-Dev] lib2to3, need some light on the imports fixer

2008-05-12 Thread Guilherme Polo
Hello, Would someone tell me how can I add a new entry in the MAPPING dict in the lib2to3/fixes/fix_imports.py that does the following: "import A" gets fixed as "import C.D as A" Right now it is fixing by doing "import C.D" and changing several other lines in the code to use this new "C.D" name.

Re: [Python-Dev] Copying cgi.parse_qs() to the urllib.parse module

2008-05-12 Thread Tom Pinckney
Is there any thought to extending escape to escape / unescape to by default handle characters other than <, >, and &? At a minimum it should handle arbitrary &xxx; values. Ideally, it would also handle common other symbolic names besides < > etc. HTML from common web sites such as nytimes.c

Re: [Python-Dev] Adding start to enumerate()

2008-05-12 Thread Steve Holden
Steven D'Aprano wrote: On Mon, 12 May 2008 08:20:51 am Georg Brandl wrote: I believe the following is a common use-case for enumerate() (at least, I've used it quite some times): for lineno, line in enumerate(fileobject): ... For this, it would be nice to have a start parameter for enumer

Re: [Python-Dev] How best to handle the docs for a renamed module?

2008-05-12 Thread Alexandre Vassalotti
On Mon, May 12, 2008 at 6:10 AM, Georg Brandl <[EMAIL PROTECTED]> wrote: > I've now updated docs for the Queue, SocketServer and copy_reg modules in > the trunk. > Thank you, Georg, for updating docs! -- Alexandre ___ Python-Dev mailing list Python-De

Re: [Python-Dev] Problems with the new super()

2008-05-12 Thread Isaac Morland
On Fri, 2 May 2008, Greg Ewing wrote: Guido van Rossum wrote: The alternative would be to make it a keyword, which seemed excessive (plus, it would be odd if super() were a keyword when self is not). If it's really such a useful thing as to warrant so much magic to support it, then I think it

Re: [Python-Dev] Buildbots have trouble checking out the repository due to recent changes.

2008-05-12 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On May 12, 2008, at 9:47 AM, Alexandre Vassalotti wrote: On Mon, May 12, 2008 at 9:24 AM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: The idea was to replace the orignial module file with its stub. However, the "svn copy" and edit process isn't t

Re: [Python-Dev] Buildbots have trouble checking out the repository due to recent changes.

2008-05-12 Thread Martin v. Löwis
> Hmm, that's interesting information. I suspect I could easily create > more bugs than I solve by using it, but it's interesting to know > nevertheless. I've been trying to use for a few applications. The biggest short-coming is that it won't work for all cases. In particular, for the following o

Re: [Python-Dev] Copying cgi.parse_qs() to the urllib.parse module

2008-05-12 Thread Tony Nelson
At 11:56 PM -0400 5/10/08, Fred Drake wrote: >On May 10, 2008, at 11:49 PM, Guido van Rossum wrote: >> Works for me. The other thing I always use from cgi is escape() -- >> will that be available somewhere else too? > > >xml.sax.saxutils.escape() would be an appropriate replacement, though >the loc

Re: [Python-Dev] Buildbots have trouble checking out the repository due to recent changes.

2008-05-12 Thread Paul Moore
2008/5/12 "Martin v. Löwis" <[EMAIL PROTECTED]>: > > 1.0. There are still case folding bugs in 1.0 - I'm working on fixing > > them. But there will never be a complete fix for this situation, as > > it's simply not possible to checkout the exact svn layout of that > > revision on a case-folding

Re: [Python-Dev] Buildbots have trouble checking out the repository due to recent changes.

2008-05-12 Thread Martin v. Löwis
> 1.0. There are still case folding bugs in 1.0 - I'm working on fixing > them. But there will never be a complete fix for this situation, as > it's simply not possible to checkout the exact svn layout of that > revision on a case-folding system, it simply can't be supported > (without name manglin

Re: [Python-Dev] Buildbots have trouble checking out the repository due to recent changes.

2008-05-12 Thread Martin v. Löwis
> Hmm, Guido's been at the time machine again :-) > >> svn log http://svn.python.org/projects/python/trunk | tail > > r2161 | guido | 1990-08-09 15:25:15 +0100 (Thu, 09 Aug 1990) | 2 lines > > Initial revision > > -

Re: [Python-Dev] Buildbots have trouble checking out the repository due to recent changes.

2008-05-12 Thread Paul Moore
2008/5/12 Paul Moore <[EMAIL PROTECTED]>: > 2008/5/12 "Martin v. Löwis" <[EMAIL PROTECTED]>: > > Subversion's first release was in October 2000; it wasn't self-hosting > > until 2001 :-) > > I assume it's pre-svn history, converted from CVS. Or I'm misreading > something. Whatever, it's from

Re: [Python-Dev] Buildbots have trouble checking out the repository due to recent changes.

2008-05-12 Thread Paul Moore
2008/5/12 Alexandre Vassalotti <[EMAIL PROTECTED]>: > Which version of mercurial are you using? I know that versions prior > 1.0 had some bug with handling case-changes on case-insensitive > filesystems. 1.0. There are still case folding bugs in 1.0 - I'm working on fixing them. But there will

Re: [Python-Dev] Buildbots have trouble checking out the repository due to recent changes.

2008-05-12 Thread Paul Moore
2008/5/12 "Martin v. Löwis" <[EMAIL PROTECTED]>: > > Revision 63129 is not valid on case folding filesystems. In > > particular, this horribly breaks using hg-svn to make a local mirror > > of the Python repository: > > That would be a bug in hg-svn, right? Yes, the revision is not valid > on c

Re: [Python-Dev] Buildbots have trouble checking out the repository due to recent changes.

2008-05-12 Thread Alexandre Vassalotti
On Mon, May 12, 2008 at 9:24 AM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > The idea was to replace the orignial module file with its stub. > > However, the "svn copy" and edit process isn't the cause of the > > problems. It is the fact that 2 files existed in the same directory > > differ

Re: [Python-Dev] Buildbots have trouble checking out the repository due to recent changes.

2008-05-12 Thread Martin v. Löwis
> The idea was to replace the orignial module file with its stub. > However, the "svn copy" and edit process isn't the cause of the > problems. It is the fact that 2 files existed in the same directory > differing only by a case-change. I still don't understand. You wanted to replace the file with

Re: [Python-Dev] Buildbots have trouble checking out the repository due to recent changes.

2008-05-12 Thread Alexandre Vassalotti
On Mon, May 12, 2008 at 7:18 AM, Paul Moore <[EMAIL PROTECTED]> wrote: > Revision 63129 is not valid on case folding filesystems. In > particular, this horribly breaks using hg-svn to make a local mirror > of the Python repository: > > >\Apps\HGsvn\hgimportsvn.exe -r 63120 > http://svn.python.

Re: [Python-Dev] Buildbots have trouble checking out the repository due to recent changes.

2008-05-12 Thread Alexandre Vassalotti
On Mon, May 12, 2008 at 3:49 AM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Well, I guess I really messed up on that one. So, do you have any idea > > on how to revert the changes? > > If the changes where in a single revision N, do > > svn merge -rN:N-1 . > svn commit -m "revert rN" > >

Re: [Python-Dev] Buildbots have trouble checking out the repository due to recent changes.

2008-05-12 Thread Alexandre Vassalotti
On Mon, May 12, 2008 at 3:40 AM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > When I rename a module I use "svn copy", since "svn remove" doesn't > > pick up changes made to the "deleted" file. For example, here is what > > I did for PixMapWrapper: > > You want to make changes to the deleted

Re: [Python-Dev] On quote styles

2008-05-12 Thread Isaac Morland
On Sun, 11 May 2008, Greg Ewing wrote: While Python doesn't have a char type (yet), I still find the distinction between 'c' and "abc" useful to show intent (especially given my C background The way I tend to use them is that "xxx" is for data operated on by the program and seen by the user, a

Re: [Python-Dev] Buildbots have trouble checking out the repository due to recent changes.

2008-05-12 Thread Martin v. Löwis
> Revision 63129 is not valid on case folding filesystems. In > particular, this horribly breaks using hg-svn to make a local mirror > of the Python repository: That would be a bug in hg-svn, right? Yes, the revision is not valid on case-folding systems - but why should that break hg-svn? The tool

Re: [Python-Dev] Buildbots have trouble checking out the repository due to recent changes.

2008-05-12 Thread Paul Moore
2008/5/12 Paul Moore <[EMAIL PROTECTED]>: > Bazaar seems to be OK (ish) with this - it picks just one version to show. It seems to be unable to find the history using either bzr log Lib\socketserver.py or bzr log Lib\SocketServer.py, though (but bzr log seems pretty unintuitive to me, so maybe I

Re: [Python-Dev] Buildbots have trouble checking out the repository due to recent changes.

2008-05-12 Thread Paul Moore
2008/5/12 Alexandre Vassalotti <[EMAIL PROTECTED]>: > On Sun, May 11, 2008 at 5:29 PM, Alexandre Vassalotti > <[EMAIL PROTECTED]> wrote: > > Hello, > > > > I have been working the module renaming for PEP-3108, and I just > > noticed that some buildbots are throwing errors while updating their

Re: [Python-Dev] How best to handle the docs for a renamed module?

2008-05-12 Thread Georg Brandl
Brett Cannon schrieb: For the sake of argument, let's consider the Queue module. It is now named queue. For 2.6 I plan on having both Queue and queue listed in the index, with Queue deprecated with instructions to use the new name. But what to do about all the references. Should we leave them po

Re: [Python-Dev] Buildbots have trouble checking out the repository due to recent changes.

2008-05-12 Thread Martin v. Löwis
> Well, I guess I really messed up on that one. So, do you have any idea > on how to revert the changes? If the changes where in a single revision N, do svn merge -rN:N-1 . svn commit -m "revert rN" If they span over several subsequent revisions, use N-k instead. If they span over several revisi

Re: [Python-Dev] Buildbots have trouble checking out the repository due to recent changes.

2008-05-12 Thread Martin v. Löwis
> When I rename a module I use "svn copy", since "svn remove" doesn't > pick up changes made to the "deleted" file. For example, here is what > I did for PixMapWrapper: You want to make changes to the deleted file? Why? Regards, Martin ___ Python-Dev ma