Skip to content

Commit

Permalink
Fix annotation for misc.UseExisting to be Final to avoid reassign…
Browse files Browse the repository at this point in the history
…ment without warnings from a type checker.

- Also add a noqa to _mixin.URIMixin.resolve_with, since the extra `if TYPE_CHECKING`` statement pushed it over the complexity limit.

Co-authored-by: Ian Stapleton Cordasco <graffatcolmingov@gmail.com>
  • Loading branch information
Sachaa-Thanasius and sigmavirus24 committed Jun 20, 2024
1 parent ee23708 commit fadc962
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/rfc3986/_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def normalized_equality(self, other_ref: "uri.URIReference") -> bool:
"""
return tuple(self.normalize()) == tuple(other_ref.normalize())

def resolve_with(
def resolve_with( # noqa: C901
self,
base_uri: t.Union[str, "uri.URIReference"],
strict: bool = False,
Expand Down
2 changes: 1 addition & 1 deletion src/rfc3986/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ def merge_paths(base_uri: URIReferenceBase, relative_path: str) -> str:
return path[:index] + "/" + relative_path


UseExisting: t.Any = object()
UseExisting: t.Final[t.Any] = object()

0 comments on commit fadc962

Please sign in to comment.