python-hyper/hyperlink

Small type issues

euresti opened this issue · 1 comments

Hi. Thanks for adding types to hyperlink! I noticed 2 smallish improvements that could be made.

  1. It would be nice if parse_url used typing.overload to determine which type of URL it returns (i.e. DecodedURL vs URL).
  2. I believe QueryParameters could just be typed as:
QueryParameters = Iterable[Tuple[Text, Optional[Text]]

(This way it can also accepts generators and comprehensions)

Let me know if you'd like me to make a PR with these changes.

Yeah, I hadn't used overload when I wrote the type hints, so didn't think to do that. A PR would be welcome; I'd be happy to review it.