You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
332 B
20 lines
332 B
# test MicroPython-specific features of struct
|
|
|
|
try:
|
|
import ustruct as struct
|
|
except:
|
|
try:
|
|
import struct
|
|
except ImportError:
|
|
import sys
|
|
print("SKIP")
|
|
sys.exit()
|
|
|
|
class A():
|
|
pass
|
|
|
|
# pack and unpack objects
|
|
o = A()
|
|
s = struct.pack("<O", o)
|
|
o2 = struct.unpack("<O", s)
|
|
print(o is o2[0])
|
|
|