Skip to content

Commit 45ea23e

Browse files
committed
context: Use normal type hint rather than forward reference
SNode is imported and available so there's no need to use the "libyang.SNode" forward reference form. (based)pyright complains about this as it considers these forward references as `Unknown` -- perhaps it should be smarter, but that's a different issue. Signed-off-by: Christian Hopps <chopps@labn.net>
1 parent 3072af0 commit 45ea23e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libyang/context.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def find_path(
371371
self,
372372
path: str,
373373
output: bool = False,
374-
root_node: Optional["libyang.SNode"] = None,
374+
root_node: Optional[SNode] = None,
375375
) -> Iterator[SNode]:
376376
if self.cdata is None:
377377
raise RuntimeError("context already destroyed")
@@ -404,9 +404,9 @@ def find_path(
404404
def find_jsonpath(
405405
self,
406406
path: str,
407-
root_node: Optional["libyang.SNode"] = None,
407+
root_node: Optional[SNode] = None,
408408
output: bool = False,
409-
) -> Optional["libyang.SNode"]:
409+
) -> Optional[SNode]:
410410
if root_node is not None:
411411
ctx_node = root_node.cdata
412412
else:

0 commit comments

Comments
 (0)