You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
More annotations that I forgot to break up into multiple commits.
- validators.py
- Finish annotating return types.
- Change ensure_one_of takes a `Collection`, not a `Container`, since it needs to be iterable within `UnpermittedComponentError.__init__`.
- Change `authority_is_valid` to permit None as an input; continuation of making sure is_valid allowing None propogates. Also, this behavior is depended on elsewhere in the library (just one spot, I think).
- parseresult.py
- Add variable annotations to `ParseResultMixin`, and make sure _generate_authority is allowed to return `None`.
- Fix `ParseResultBytes.copy_with` not accepting an int for port.
- Annotate return type for `authority_from`.
- misc.py
- Use common base for `URIReference` and `IRIReference` as annotation for `merge_path` and remove circular import.
- exceptions.py
- Annotate everything.
- _mixin.py
- Add variable annotations to `URIMixin`; they're under a TYPE_CHECKING block so that only the subclasse's annotations can be found in cases of introspection. Might be overkill.
- Use `uri.URIReference` to annotate parameters for various functions.
- TODO: Check if these are potentially too wide, since `IRIReference` also exists and inherits from `URIMixin`?
- Use hacky "typing.cast within an elided if block" trick to improve typing within `URIMixin.resolve_with`.
0 commit comments