diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2017-09-10 23:24:08 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2017-09-11 20:54:31 +0200 |
commit | 1c276393d695f969f4600cb3adc49af71168d513 (patch) | |
tree | bfe9e373d9212ef43f06de953f8d12bb3d413ef4 /stdnum/iso7064/mod_37_36.py | |
parent | 2cc39ea459dcd712462113e12ceb5eda27de9ecb (diff) |
Docstring improvements
Diffstat (limited to 'stdnum/iso7064/mod_37_36.py')
-rw-r--r-- | stdnum/iso7064/mod_37_36.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/stdnum/iso7064/mod_37_36.py b/stdnum/iso7064/mod_37_36.py index 0787e5a..6b3dea5 100644 --- a/stdnum/iso7064/mod_37_36.py +++ b/stdnum/iso7064/mod_37_36.py @@ -51,14 +51,14 @@ def checksum(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'): def calc_check_digit(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'): - """With the provided number, calculate the extra digit that should be - appended to make it a valid number.""" + """Calculate the extra digit that should be appended to the number to + make it a valid number.""" modulus = len(alphabet) return alphabet[(1 - ((checksum(number, alphabet) or modulus) * 2) % (modulus + 1)) % modulus] def validate(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'): - """Checks whether the check digit is valid.""" + """Check whether the check digit is valid.""" try: valid = checksum(number, alphabet) == 1 except Exception: @@ -69,7 +69,7 @@ def validate(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'): def is_valid(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'): - """Checks whether the check digit is valid.""" + """Check whether the check digit is valid.""" try: return bool(validate(number, alphabet)) except ValidationError: |