8000 Fix flake8 error · unho/python-stdnum@9f79691 · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit 9f79691

Browse files
committed
Fix flake8 error
This stops using not as a function and hopefully also makes the logic clearer.
1 parent a280d53 commit 9f79691

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

stdnum/it/iva.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ def validate(number):
5757
if len(number) != 11:
5858
raise InvalidLength()
5959
# check the province of residence
60-
if not('001' <= number[7:10] <= '100') and \
61-
number[7:10] not in ('120', '121', '888', '999'):
60+
if not ('001' <= number[7:10] <= '100' or number[7:10] in ('120', '121', '888', '999')):
6261
raise InvalidComponent()
6362
luhn.validate(number)
6463
return number

update/iban.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def get_country_codes(line):
5959
# output the collected data
6060
for i, data in values.items():
6161
bban = data['BBAN structure']
62-
if not(bban) or bban.lower() == 'n/a':
62+
if not bban or bban.lower() == 'n/a':
6363
bban = data['IBAN structure']
6464
bban = bban.replace(' ', '')
6565
cc = data['IBAN prefix country code (ISO 3166)'][:2]

0 commit comments

Comments
 (0)
0