@@ -9,7 +9,7 @@ Common Interface
99
1010Most of the number format modules implement the following functions:
1111
12- .. function :: module.validate(number)
12+ .. function :: module.validate(number: str) -> str
1313
1414 Validate the number and return a compact, consistent representation of
1515 the number or code. If the validation fails,
@@ -19,23 +19,23 @@ Most of the number format modules implement the following functions:
1919 :raises ValidationError: When the specified number is invalid
2020 :returns: str -- A compact (canonical) representation of the number
2121
22- .. function :: module.is_valid(number)
22+ .. function :: module.is_valid(number: str) -> bool
2323
2424 Return either ``True `` or ``False `` depending on whether the passed number
2525 is in any supported and valid form and passes all embedded checks of the
2626 number. This function should never raise an exception.
2727
2828 :returns: bool -- ``True `` if validated, ``False `` otherwise
2929
30- .. function :: module.compact(number)
30+ .. function :: module.compact(number: str) -> str
3131
3232 Return a compact representation of the number or code. This function
3333 generally does not do validation but may raise exceptions for wildly
3434 invalid numbers.
3535
3636 :returns: str -- The compacted number
3737
38- .. function :: module.format(number)
38+ .. function :: module.format(number: str) -> str
3939
4040 Return a formatted version of the number in the preferred format.
4141 This function generally expects to be passed a valid number or code and
@@ -45,15 +45,15 @@ Most of the number format modules implement the following functions:
4545
4646The check digit modules generally also provide the following functions:
4747
48- .. function :: module.checksum(number)
48+ .. function :: module.checksum(number: str) -> int
4949
5050 Calculate the checksum over the provided number. This is generally a
5151 number that can be used to determine whether the provided number is
5252 valid. It depends on the algorithm which checksum is considered valid.
5353
5454 :returns: int -- A numeric checksum over the number
5555
56- .. function :: module.calc_check_digit(number)
56+ .. function :: module.calc_check_digit(number: str) -> str
5757
5858 Calculate the check digit that should be added to the number to make it
5959 valid.
0 commit comments