seanpianka / Zipcodes

A simple library for querying U.S. zipcodes.
MIT License
78 stars 15 forks source link

pypi example shows TypeError thrown, but zipcodes throws ValueError #21

Closed zintegy closed 2 years ago

zintegy commented 2 years ago

https://pypi.org/project/zipcodes/ explains that each invalid zip code will throw a TypeError:

>>> 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.