The inline type stub at usaddress/__init__.pyi (added per #371) defines parse, tag, tokenize, etc., but omits the RepeatedLabelError exception class.
The class exists at runtime in __init__.py:
class RepeatedLabelError(probableparsing.RepeatedLabelError):
REPO_URL = "https://github.com/datamade/usaddress/issues/new"
DOCS_URL = "https://usaddress.readthedocs.io/"
Because the stub omits it, code that catches the exception triggers a type-checker error (pyright reportAttributeAccessIssue, mypy attr-defined):
import usaddress
try:
usaddress.tag("...")
except usaddress.RepeatedLabelError: # error: not a known attribute of module "usaddress"
pass
This forces downstream users to add # type: ignore / # pyright: ignore purely to work around a stub gap.
Suggested fix — add to __init__.pyi:
import probableparsing
class RepeatedLabelError(probableparsing.RepeatedLabelError):
REPO_URL: str
DOCS_URL: str
message: str
original_string: str
parsed_string: list[tuple[str, str]]
(The __init__ signature is inherited from probableparsing.RepeatedLabelError(original_string, parsed_string, repeated_label).)
Version: usaddress 0.5.16, Python 3.13.
The inline type stub at
usaddress/__init__.pyi(added per #371) definesparse,tag,tokenize, etc., but omits theRepeatedLabelErrorexception class.The class exists at runtime in
__init__.py:Because the stub omits it, code that catches the exception triggers a type-checker error (pyright
reportAttributeAccessIssue, mypyattr-defined):This forces downstream users to add
# type: ignore/# pyright: ignorepurely to work around a stub gap.Suggested fix — add to
__init__.pyi:(The
__init__signature is inherited fromprobableparsing.RepeatedLabelError(original_string, parsed_string, repeated_label).)Version: usaddress 0.5.16, Python 3.13.