def unpack(self, value):
"""Unpack a value using Python's struct.unpack()"""
assert(self.pack_format is not None)
# Note: "The result is a tuple even if it contains exactly one item."
# (https://docs.python.org/2/library/struct.html#struct.unpack)
# For single-valued data types, use AdsSingleValuedDatatype to get the
# first (and only) entry of the tuple after unpacking.
return struct.unpack(self.pack_format, value)
评论列表
文章目录