Ricardo Aráoz wrote:

> _validChars = {
>                 'X' :
> 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
>                 , '9' : '1234567890'
>                 , '-' : '-1234567890'
>                 , 'A' :
> 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
>                 , '!' : 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'}
> _validKeys = _validChars.keys()

<snip>
>         while maskChar not in _validKeys :

There is no need to make _validKeys, you can write
   while maskChar not in _validChars
which is actually more efficient, in general, because it is a hash table 
lookup instead of searching a list.

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to