Skip to content
Snippets Groups Projects
Commit 5d0d3ae4 authored by Pavel Spirek's avatar Pavel Spirek Committed by Ladislav Lhotka
Browse files

Improved constructors of ArrayValue and ObjectValue

parent 68d92ee1
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,10 @@ class StructuredValue:
class ArrayValue(StructuredValue, list):
"""Array values corresponding to YANG lists and leaf-lists."""
def __init__(self, ts: datetime=None, val=None):
StructuredValue.__init__(self, ts)
if val is not None:
list.__init__(self, val)
def __hash__(self) -> int:
"""Return an integer hash value for the receiver."""
......@@ -43,6 +47,10 @@ class ArrayValue(StructuredValue, list):
class ObjectValue(StructuredValue, dict):
"""Array values corresponding to YANG container."""
def __init__(self, ts: datetime=None, val=None):
StructuredValue.__init__(self, ts)
if val is not None:
dict.__init__(self, val)
def __hash__(self) -> int:
"""Return an integer hash value for the receiver."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment