>>> print(zipcodes.matching('06463'))
[]
>>> # Until it cannot.
>>> zipcodes.matching('0646a')
Traceback (most recent call last):
...
TypeError: Invalid characters, zipcode may only contain digits and "-".
>>> zipcodes.matching('064690')
Traceback (most recent call last):
...
TypeError: Invalid format, zipcode must be of the format: "#####" or "#####-####"
>>> zipcodes.matching(None)
Traceback (most recent call last):
...
TypeError: Invalid type, zipcode must be a string.
But zipcodes package actually throws a ValueError in the second and third examples above.
https://pypi.org/project/zipcodes/ explains that each invalid zip code will throw a
TypeError
:But
zipcodes
package actually throws aValueError
in the second and third examples above.