circuitpython/tests/basics/class_bytes.py

10 lines
158 B
Python
Raw Normal View History

2019-10-14 19:05:17 -04:00
class C1:
def __init__(self, value):
self.value = value
def __bytes__(self):
return self.value
c1 = C1(b"class 1")
print(bytes(c1))