mirror of
https://github.com/micropython/micropython.git
synced 2026-04-25 02:10:24 +02: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')
|