REPOST: Re: Range of characters?

Jeff Shannon jeff at ccvcorp.com
Thu Dec 27 13:16:00 EST 2001


Chris Dutton wrote:

> in article 3C2A074D.8214E5E0 at earthlink.net, Mari Mcdade at
> wurmy at earthlink.net wrote on 12/26/01 12:27 PM:
>
> > You don't need the string module, really, but using the literal
> > string "ABCDEFGHIJKLMNOPQRSTUVWXYZ" seemed a bit ugly. ;-)
>
> Well, this is even less ugly then.
>
> from string import uppercase as u
> for c in u:
>     print "%sython" % c

I disagree that this is less ugly--it needlessly obfuscates the code,
since at the for-loop, it's totally opaque as to what it is that
you're iterating over.  I *much* prefer having it read the very
explicit 'string.uppercase' to having it only cryptically refer to
'u'.

Jeff Shannon
Technician/Programmer
Credit International

========= WAS CANCELLED BY =======:
Path: news.sol.net!spool0-milwwi.newsops.execpc.com!newsfeeds.sol.net!newspump.sol.net!nntp1.roc.gblx.net!nntp.gblx.net!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!enews.sgi.com!news-xfer.nuri.net!feeder.kornet.net!news1.kornet.net!ua4canc3ll3r
From: Jeff Shannon <jeff at ccvcorp.com>
Newsgroups: comp.lang.python
Subject: cmsg cancel <3C2B655F.92E3896E at ccvcorp.com>
Control: cancel <3C2B655F.92E3896E at ccvcorp.com>
Date: Mon, 31 Dec 2001 03:10:04 GMT
Organization: A poorly-installed InterNetNews site
Lines: 2
Message-ID: <cancel.3C2B655F.92E3896E at ccvcorp.com>
NNTP-Posting-Host: 211.57.49.2
X-Trace: news2.kornet.net 1009775691 27193 211.57.49.2 (31 Dec 2001 05:14:51 GMT)
X-Complaints-To: usenet at news2.kornet.net
NNTP-Posting-Date: Mon, 31 Dec 2001 05:14:51 +0000 (UTC)
X-No-Archive: yes
X-Unac4ncel: yes
X-Commentary: I love NewsAgent 1.10 and the Sandblaster Cancel Engine Build 74 (19 March 1999)

This message was cancelled from within Mozilla.



More information about the Python-list mailing list