From fb54736bdb5c01a4051a77c8b048502c6a41e044 Mon Sep 17 00:00:00 2001 From: stijn Date: Mon, 20 May 2019 10:35:31 +0200 Subject: py/objarray: Add decode method to bytearray. Reuse the implementation for bytes since it works the same way regardless of the underlying type. This method gets added for CPython compatibility of bytearray, but to keep the code simple and small array.array now also has a working decode method, which is non-standard but doesn't hurt. --- tests/basics/bytearray_decode.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/basics/bytearray_decode.py (limited to 'tests') diff --git a/tests/basics/bytearray_decode.py b/tests/basics/bytearray_decode.py new file mode 100644 index 000000000..b5e1cb419 --- /dev/null +++ b/tests/basics/bytearray_decode.py @@ -0,0 +1,6 @@ +try: + print(bytearray(b'').decode()) + print(bytearray(b'abc').decode()) +except AttributeError: + print("SKIP") + raise SystemExit -- cgit v1.2.3