diff options
author | stijn <stijn@ignitron.net> | 2019-05-20 10:35:31 +0200 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-05-21 14:24:04 +1000 |
commit | fb54736bdb5c01a4051a77c8b048502c6a41e044 (patch) | |
tree | 38520561d642d8ffc29d93759a437aa6ba67be3e /tests/basics/bytearray_decode.py | |
parent | c769da1aaa28fb0eba9fabfba84c39cbc09e23da (diff) |
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.
Diffstat (limited to 'tests/basics/bytearray_decode.py')
-rw-r--r-- | tests/basics/bytearray_decode.py | 6 |
1 files changed, 6 insertions, 0 deletions
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 |