Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/stdnum/no/orgnr.py
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2017-09-10 23:24:08 +0200
committerArthur de Jong <arthur@arthurdejong.org>2017-09-11 20:54:31 +0200
commit1c276393d695f969f4600cb3adc49af71168d513 (patch)
treebfe9e373d9212ef43f06de953f8d12bb3d413ef4 /stdnum/no/orgnr.py
parent2cc39ea459dcd712462113e12ceb5eda27de9ecb (diff)
Docstring improvements
Diffstat (limited to 'stdnum/no/orgnr.py')
-rw-r--r--stdnum/no/orgnr.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/stdnum/no/orgnr.py b/stdnum/no/orgnr.py
index 993d9da..ebceac8 100644
--- a/stdnum/no/orgnr.py
+++ b/stdnum/no/orgnr.py
@@ -52,8 +52,8 @@ def checksum(number):
def validate(number):
- """Checks to see if the number provided is a valid organisation number.
- This checks the length, formatting and check digit."""
+ """Check if the number is a valid organisation number. This checks the
+ length, formatting and check digit."""
number = compact(number)
if not number.isdigit():
raise InvalidFormat()
@@ -65,8 +65,7 @@ def validate(number):
def is_valid(number):
- """Checks to see if the number provided is a valid organisation number.
- This checks the length, formatting and check digit."""
+ """Check if the number is a valid organisation number."""
try:
return bool(validate(number))
except ValidationError:
@@ -74,6 +73,6 @@ def is_valid(number):
def format(number):
- """Reformat the passed number to the standard format."""
+ """Reformat the number to the standard presentation format."""
number = compact(number)
return number[:3] + ' ' + number[3:6] + ' ' + number[6:]