[CentralOH] Evil Magic Number Ugliness

michael at yanovich.net michael at yanovich.net
Mon Nov 11 18:55:39 CET 2013


On 11/11/2013 12:50 PM, jep200404 at columbus.rr.com wrote:
> On Mon, 11 Nov 2013 12:34:50 -0500, michael at yanovich.net wrote:
> 
>> In [8]: ''.join([chr(x) for x in range(65,65+26)])
> 
> The following makes clear the meaning of the above evil magic numbers.
> 
> ''.join([chr(c) for c in range(ord('A'), ord('Z') + 1)])
>

Yea, I was just whipping something up as an alternative example to the first
thing example I posted; but yea I agree the more "correct" solution would be
the example you listed with the magic numbers removed.

-- 
Michael Yanovich

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/centraloh/attachments/20131111/e889fe76/attachment.sig>


More information about the CentralOH mailing list