mirror of
https://github.com/licsber/micropython.git
synced 2024-09-20 09:00:23 +08:00
9162a87d4d
Using bytes will test the same path for the buffer protocol in py/objtype.c.
10 lines
127 B
Python
10 lines
127 B
Python
# converting user instance to buffer
|
|
class C:
|
|
pass
|
|
|
|
c = C()
|
|
try:
|
|
d = bytes(c)
|
|
except TypeError:
|
|
print('TypeError')
|