On 19/03/18 10:52, Daniel P. Berrangé wrote:
>> -o = ord(line[i])
>> -if (o >= 97 and o <= 122) or (o >= 65 and o <= 90) or \
>> - (o >= 48 and o <= 57):
>> +if re.match(r"[a-zA-Z0-9]", line[i]):
> Why not just use isalnum()
On Sat, Mar 17, 2018 at 02:23:27PM +, Radostin Stoyanov wrote:
> Improve readability by reducing the complexity and length of
> conditional statements.
>
> Example: The following condition:
>
> if (o >= 97 and o <= 122) or
> (o >= 65 and o <= 90) or
> (o >= 48 and o
Improve readability by reducing the complexity and length of
conditional statements.
Example: The following condition:
if (o >= 97 and o <= 122) or
(o >= 65 and o <= 90) or
(o >= 48 and o <= 57) or
(" \t(){}:;,+-*/%&!|[]=><".find(line[i]) == -1):
Will be