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 mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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 revisions with intermediate
revisions that you don't want to revert, try multiple merge
commands before a single commit; if that fails, revert and commit
each range of changes separately.

Regards,
Martin

P.S. If you want to get the buildbots back in shape (in case they
aren't), build a non-existing branch through the UI
(which will cause a recursive removal of the entire checkout), then
either wait for the next regular commit, or force a build of the
respective branch (branches/py3k or trunk). On Windows, if there
is still a python.exe process holding onto its binary, that fails,
and we need support from the slave admin.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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 pointing
at Queue to lessen confusion for people who read about some module on
some other site that isn't using the new name, or update everything in
2.6 to use the new name?


I've now updated docs for the Queue, SocketServer and copy_reg modules in
the trunk.

* File names (only important for copy_reg) and references use the new name.
* There are two "module" directives in the file; one for the old, one for the
  new name. The synopsis of the old name is "Old name of the XXX module."
* There is a note after the module directives that tells

   The :mod:`XXX` module has been renamed to :mod:`YYY` in Python 3.0.  It
   is importable under both names in Python 2.6 and the rest of the 2.x series.

Georg

--
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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
>  > checkout. It seems the method I use for renaming modules hits a
>  > subversion bug on certain platforms. The error thrown looks like this:
>  [SNIP]
>
> > So, how should I do to fix the failing buildbots?
>  >
>
>  I reverted the all problematic changes and the buildbots are green again.
>
>  Thank you all for you support!

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.org/projects/python/trunk foo
>cd foo
>\apps\hgsvn\hgpullsvn
>hg log Lib\socketserver.py
changeset:   2:e8856fdf9300
branch:  trunk
tag: svn.63129
user:alexandre.vassalotti
date:Mon May 12 02:37:10 2008 +0100
summary: [svn] Renamed SocketServer to 'socketserver'.

>hg up -r2
abort: case-folding collision between Lib/socketserver.py and
Lib/SocketServer.py

>hg up -rtip
abort: case-folding collision between Lib/socketserver.py and
Lib/SocketServer.py

The hg repository is now totally broken.

I'm not sure there is a fix for this, short of going back and manually
fixing the history (and I don't know if this is possible at all using
Subversion).

I know it's a rare situation, but can people PLEASE be careful not to
introduce case issues like this - they pollute history for ever (I
still hit problems with some of the case funkiness in svn from the
early 1990's!!!)

Bazaar seems to be OK (ish) with this - it picks just one version to show.
Paul.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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 was using it
wrongly...)

Paul.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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
should be able to represent such stuff in its repository (whatever
concept of repository hg may have); it should then only fail if you also
want to check out that specific revision.

There is no way to remove this revision from the repository now
(other than a full dump|filter|load cycle, which I would rather want to
avoid).

> I know it's a rare situation, but can people PLEASE be careful not to
> introduce case issues like this - they pollute history for ever (I
> still hit problems with some of the case funkiness in svn from the
> early 1990's!!!)

Subversion's first release was in October 2000; it wasn't self-hosting
until 2001 :-)

Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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,
and 'xxx' is for things that are only used internally,
e.g. enumerated type values and attribute names for use
by getattr().


I find myself doing something similar.  I use '' for anything that is a 
dictionary key and "" for things that are strings not meant to be used for 
indexing, in particular the things that are looked up.  Except when I 
don't.


When I am generating HTML using the ll.xist library, which uses constructs 
like this:


html.a (u'link text', href="http://url.goes.here/";)

I have just started using '' for text element contents and "" for 
attribute values.  This way the attribute values (keyword parameters) look 
almost the exact same as in actual HTML (only difference is the commas) 
(and the escaping), and my editor seems to be designed for C-style 
languages where '' are for character constants and "" are for strings so 
it highlights them differently.


My personal opinion is that one should not use the different quoting 
styles at random, but I am inclined to believe that there is no single 
guideline that can apply to everybody.


Isaac Morland   CSCF Web Guru
DC 2554C, x36650WWW Software Specialist
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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 file? Why?
>

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.

Anyway, all the buildbot seems okay now.

-- Alexandre
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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"
>
>  If they span over several subsequent revisions, use N-k
>  instead. If they span over several revisions with intermediate
>  revisions that you don't want to revert, try multiple merge
>  commands before a single commit; if that fails, revert and commit
>  each range of changes separately.
>


Yes. That is exactly what I did to revert the changes.

>
>  P.S. If you want to get the buildbots back in shape (in case they
>  aren't), build a non-existing branch through the UI
>  (which will cause a recursive removal of the entire checkout), then
>  either wait for the next regular commit, or force a build of the
>  respective branch (branches/py3k or trunk). On Windows, if there
>  is still a python.exe process holding onto its binary, that fails,
>  and we need support from the slave admin.
>

Thanks for the tip. Now, I just hope that I will never have to use it. ;-)

-- Alexandre
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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.org/projects/python/trunk foo
>  >cd foo
>  >\apps\hgsvn\hgpullsvn
>  >hg log Lib\socketserver.py
>  changeset:   2:e8856fdf9300
>  branch:  trunk
>  tag: svn.63129
>  user:alexandre.vassalotti
>  date:Mon May 12 02:37:10 2008 +0100
>  summary: [svn] Renamed SocketServer to 'socketserver'.
>
>  >hg up -r2
>  abort: case-folding collision between Lib/socketserver.py and
>  Lib/SocketServer.py
>
>  >hg up -rtip
>  abort: case-folding collision between Lib/socketserver.py and
>  Lib/SocketServer.py
>
>  The hg repository is now totally broken.
>

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.

-- Alexandre
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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 a stub,
and then delete it? Why not just delete it (or use svn mv in the first
place)?

Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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
>  > differing only by a case-change.
>
>  I still don't understand. You wanted to replace the file with a stub,
>  and then delete it? Why not just delete it (or use svn mv in the first
>  place)?

No. That is exactly what I wanted to avoid by using "svn copy",
instead of "svn move". "svn move" mark the original file for removal.
which makes it impossible to modify the original file on the same
commit. Anyway, Brett updated the PEP with renaming procedure that
avoids this problem completely.

-- Alexandre
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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 case-folding systems - but why should that break hg-svn? The tool
>  should be able to represent such stuff in its repository (whatever
>  concept of repository hg may have); it should then only fail if you also
>  want to check out that specific revision.

Absolutely it's a bug in hgsvn (which is a converter for svn -> hg,
this isn't a bug in hg), but it's a design issue (hgsvn works by
checking out each revision in turn and checking it into hg) triggered
by having a svn revision which cannot be represented on a case-folsing
system.

>  There is no way to remove this revision from the repository now
>  (other than a full dump|filter|load cycle, which I would rather want to
>  avoid).

OK, there's no way this is justified for such an obscure issue - all
I'm really asking is that people remember case-folding systems when
making changes like this.

>  > I know it's a rare situation, but can people PLEASE be careful not to
>  > introduce case issues like this - they pollute history for ever (I
>  > still hit problems with some of the case funkiness in svn from the
>  > early 1990's!!!)
>
>  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 a long time ago :-)

Paul.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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 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 mangling of files in the working directory).

As I said, it's no big deal, just something people working on
case-sensitive systems need to watch out for when interoperation with
case-insensitive systems is important.

Paul.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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 a long time ago :-)

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


r2160 | (no author) | 1990-08-09 15:25:15 +0100 (Thu, 09 Aug 1990) | 1 line

New repository initialized by cvs2svn.


Paul.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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
> 
> 
> r2160 | (no author) | 1990-08-09 15:25:15 +0100 (Thu, 09 Aug 1990) | 1 line
> 
> New repository initialized by cvs2svn.
> 

Actually, I will borrow the machine five years from now to create these
files, after we switch back from hg to svn :-)

svn log -r2158 http://svn.python.org/projects

r2158 | bwarsaw | 2005-10-24 00:39:17 +0200 (Mo, 24 Okt 2005) | 3 lines


PEP 351, the freeze protocol.



Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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 mangling of files in the working directory).

Assuming this is NTFS, notice that it is not the file system that is
case-folding, but the API. If you pass FILE_FLAGS_POSIX_SEMANTICS to
the API, you can get case-sensitive behavior (to some degree, as there
are bugs in that API, as well).

Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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 system, it simply can't be supported
>  > (without name mangling of files in the working directory).
>
>  Assuming this is NTFS, notice that it is not the file system that is
>  case-folding, but the API. If you pass FILE_FLAGS_POSIX_SEMANTICS to
>  the API, you can get case-sensitive behavior (to some degree, as there
>  are bugs in that API, as well).

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.

Thanks,
Paul.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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 location is a little funky.

At least it's right next to the valuable quoteattr().
-- 

TonyN.:'   
  '  
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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
operations I could not find a way to make them case-sensitive (as they
don't accept any flags parameter): DeleteFile (apparently possible
through NtDeleteFile), CreateDirectory, RemoveDirectory, FindFirstFile
(and probably others as well).

Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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 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 a stub,
and then delete it? Why not just delete it (or use svn mv in the  
first

place)?


No. That is exactly what I wanted to avoid by using "svn copy",
instead of "svn move". "svn move" mark the original file for removal.
which makes it impossible to modify the original file on the same
commit. Anyway, Brett updated the PEP with renaming procedure that
avoids this problem completely.


bzr to the rescue .

- -Barry

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Darwin)

iQCVAwUBSChX5nEjvBPtnXfVAQK2NwQAgA3Gaa7Ew6uAVrqJe3B9wj/lseMuS88j
y4/gtlCcb35Vtff9CpEveCD44IelaB+OFH2iG6TKXxxD47HhYfJD3STRWnphimb8
j4UXJyfJTlMIW7ISWGzv62c+RlyXle8P0VXwdfDvem8h3o8cWDBBACvlqA/6wjb0
FFQuLHedW+8=
=r0hs
-END PGP SIGNATURE-
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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 deserves to have a
keyword.

Conversely, I would say that if it doesn't deserve a
keyword, it also doesn't deserve that much magic.


One might even go further and say that if it's that magic, then it's a 
keyword by definition.


Certainly I would want a syntax-highlighting editor to highlight it 
somehow, and if the editor has a "rename" feature to rename a variable and 
replace all references to it (but not other uses of the same identifiers 
in different scope), then it probably should at least alert the programmer 
before allowing a rename to or from the magic name.


Isaac Morland   CSCF Web Guru
DC 2554C, x36650WWW Software Specialist
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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 enumerate().


Why would it be nice? What would you use it for?

The only thing I can think of is printing lines with line numbers, and 
starting those line numbers at one instead of zero. If that's the only 
use-case, should it require built-in support?


It's fairly common in financial applications to number checks in 
batches, from a starting point that depends on the number of checks 
issued in previous runs. Having a start point would allow this to be 
done more simply, though it's not anyway what I would call an onerous task.


regards
 Steve
--
Steve Holden+1 571 484 6266   +1 800 494 3119
Holden Web LLC  http://www.holdenweb.com/

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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.com frequently has a  
variety of characters escaped.


Consider the page at 
http://travel.nytimes.com/travel/guides/europe/france/provence-and-the-french-riviera/overview.html

It lists its content type as:
content="text/html; charset=UTF-8"
And contains text like:
There’s the Côte d’
Ideally, we would decode ’ into ’ and ô into ô.
Unfortunately, #146 is really an error -- it's not a utf-8 encoded  
unicode character but really a MS codepage 1252 character for  
apostrophe (apparently may HTML editing systems intermingle unicode  
and codepage 1252 content for apostrophes and a few other common  
characters).
I'm happy to contribute some additional code for these other cases if  
people agree it's useful.




On May 12, 2008, at 10:36 AM, Tony Nelson wrote:


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 location is a little funky.


At least it's right next to the valuable quoteattr().
--

TonyN.:'   
 '  
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/thomaspinckney3%40gmail.com


___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[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. I wanted to avoid
these changes if possible.


Regards,

-- 
-- Guilherme H. Polo Goncalves
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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 doing "import C.D" and changing several
>  other lines in the code to use this new "C.D" name. I wanted to avoid
>  these changes if possible.

I don't believe there's a way to do that, but adding support for it
should be fairly straight-forward. Assign the patch to me for review.

Collin Winter
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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.":


'I am a string.'

'I am a string.'

"I'm a string"

"I'm a string"


Nice. :)

- -Barry

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Darwin)

iQCVAwUBSCi2mnEjvBPtnXfVAQJWHAP/b/2Yebt7abj+UuysjYFgzetl+26SFSFo
jXq/JZUnieIhaiCwMkJW8BW8QmxtkCn3EPDf7VUgMhxMmxDLMQ5Ougzk+/Mq5JLs
VM5zJ7kFRU4kBKReGumobSxOMUnteWNYCeUcpUDRHzEEGWFaRM0luNWUiN09iWin
DYDvVS5nSCw=
=/vGr
-END PGP SIGNATURE-
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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 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...


Cheers,
Nick.

--
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---
http://www.boredomandlaziness.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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.org/issue2831 



___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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, it can get silly. (Imagine a
string with 10 's and 9 "s, and adding two more "s to it...) But I suppose
that's another reason these are just guidelines.

Dave Borowitz

On Mon, May 12, 2008 at 5:00 PM, <[EMAIL PROTECTED]> wrote:

> > "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
> ___
> Python-Dev mailing list
> Python-Dev@python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> http://mail.python.org/mailman/options/python-dev/ddborowitz%40gmail.com
>



-- 
It is better to be quotable than to be honest.
-Tom Stoppard

Borowitz
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com