Skip to content

Commit

Permalink
Make _deref into a static method for InstanceIdentifierType
Browse files Browse the repository at this point in the history
  • Loading branch information
llhotka committed Nov 22, 2023
1 parent c2651e0 commit c4b49b6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions yangson/datatype.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,6 @@ def _derived_type(cls, stmt: Statement, sctx: SchemaContext,
res._handle_restrictions(stmt, sctx)
return res

def _deref(self: "DataType", node: InstanceNode) -> List[InstanceNode]:
return []

def _handle_properties(self: "DataType", stmt: Statement, sctx: SchemaContext) -> None:
"""Handle type substatements."""
self._handle_restrictions(stmt, sctx)
Expand Down Expand Up @@ -659,7 +656,8 @@ def from_yang(self: "InstanceIdentifierType", text: str) -> InstanceRoute:
"""Override the superclass method."""
return XPathParser(text, self.sctx).parse().as_instance_route()

def _deref(self: "InstanceIdentifierType", node: InstanceNode) -> List[InstanceNode]:
@staticmethod
def _deref(node: InstanceNode) -> List[InstanceNode]:
return [node.top().goto(node.value)]


Expand Down

0 comments on commit c4b49b6

Please sign in to comment.