From 901d6fef2249698c814bfec6b63bbc6a36c962da Mon Sep 17 00:00:00 2001 From: Christian Hopps Date: Sat, 5 Jul 2025 06:15:52 -0400 Subject: [PATCH] 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 --- libyang/context.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libyang/context.py b/libyang/context.py index f9bd5a5..2db9896 100644 --- a/libyang/context.py +++ b/libyang/context.py @@ -371,7 +371,7 @@ def find_path( self, path: str, output: bool = False, - root_node: Optional["libyang.SNode"] = None, + root_node: Optional[SNode] = None, ) -> Iterator[SNode]: if self.cdata is None: raise RuntimeError("context already destroyed") @@ -404,9 +404,9 @@ def find_path( def find_jsonpath( self, path: str, - root_node: Optional["libyang.SNode"] = None, + root_node: Optional[SNode] = None, output: bool = False, - ) -> Optional["libyang.SNode"]: + ) -> Optional[SNode]: if root_node is not None: ctx_node = root_node.cdata else: