-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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`.
- Loading branch information
1 parent
9862d65
commit 3c22353
Showing
5 changed files
with
73 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters