@@ -15,7 +15,7 @@ def complain(this):
15
15
raise UnsupportedSubclassing (
16
16
"Subclassing is not part of referencing's public API. "
17
17
"If no other suitable API exists for what you're trying to do, "
18
- "feel free to file an issue asking for one."
18
+ "feel free to file an issue asking for one." ,
19
19
)
20
20
21
21
@@ -83,7 +83,7 @@ def added_to(self, registry: Registry):
83
83
class Registry :
84
84
85
85
_contents : PMap [str , tuple [Schema , PMap [str , Schema ]]] = attrs .field (
86
- default = m (), repr = lambda value : f"({ len (value )} entries)"
86
+ default = m (), repr = lambda value : f"({ len (value )} entries)" ,
87
87
)
88
88
89
89
def resource_at (self , uri ):
@@ -145,10 +145,7 @@ def lookup(self, ref: str):
145
145
uri , fragment = urldefrag (urljoin (self ._base_uri , ref ))
146
146
if self ._registry .has_not_crawled (uri ):
147
147
root , _ = self ._registry .resource_at (self ._base_uri )
148
- for each in find_subresources (
149
- initial_base_uri = self ._base_uri ,
150
- root = root ,
151
- ):
148
+ for each in find_subresources (base_uri = self ._base_uri , root = root ):
152
149
self ._registry = each .added_to (self ._registry )
153
150
154
151
resource , anchors = self ._registry .resource_at (uri )
@@ -176,7 +173,7 @@ def with_root(self, root) -> Resolver:
176
173
else :
177
174
uri = urljoin (self ._base_uri , maybe_relative )
178
175
registry = self ._registry .with_identified_resource (
179
- uri = uri , resource = root
176
+ uri = uri , resource = root ,
180
177
)
181
178
return attrs .evolve (self , base_uri = uri , registry = registry )
182
179
@@ -194,9 +191,9 @@ def id_of(resource) -> str | None:
194
191
195
192
def find_subresources (
196
193
root : Schema ,
197
- initial_base_uri : str ,
194
+ base_uri : str ,
198
195
) -> Iterable [Anchor | DynamicAnchor | IdentifiedResource ]:
199
- resources = [(initial_base_uri , root )]
196
+ resources = [(base_uri , root )]
200
197
while resources :
201
198
base_uri , resource = resources .pop ()
202
199
if resource is True or resource is False :
0 commit comments