mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 12:10:13 +01:00
objstr: Allow to convert any buffer proto object to str.
Original motivation is to support converting bytearrays, but easier to just support buffer protocol at all.
This commit is contained in:
@@ -18,6 +18,8 @@ print(a[1:])
|
||||
print(a[:-1])
|
||||
print(a[2:3])
|
||||
|
||||
print(str(bytearray(b"123"), "utf-8"))
|
||||
|
||||
# Comparisons
|
||||
print(bytearray([1]) == bytearray([1]))
|
||||
print(bytearray([1]) == bytearray([2]))
|
||||
|
||||
Reference in New Issue
Block a user