Skip to content

Commit fadc962

Browse files
Fix annotation for misc.UseExisting to be Final to avoid reassignment 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>
1 parent ee23708 commit fadc962

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/rfc3986/_mixin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def normalized_equality(self, other_ref: "uri.URIReference") -> bool:
270270
"""
271271
return tuple(self.normalize()) == tuple(other_ref.normalize())
272272

273-
def resolve_with(
273+
def resolve_with( # noqa: C901
274274
self,
275275
base_uri: t.Union[str, "uri.URIReference"],
276276
strict: bool = False,

src/rfc3986/misc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,4 @@ def merge_paths(base_uri: URIReferenceBase, relative_path: str) -> str:
136136
return path[:index] + "/" + relative_path
137137

138138

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

0 commit comments

Comments
 (0)