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.
This commit is contained in:
stijn
2019-05-20 10:35:31 +02:00
committed by Damien George
parent c769da1aaa
commit fb54736bdb
3 changed files with 10 additions and 0 deletions

View File

@@ -102,5 +102,6 @@ MP_DECLARE_CONST_FUN_OBJ_1(str_isalpha_obj);
MP_DECLARE_CONST_FUN_OBJ_1(str_isdigit_obj);
MP_DECLARE_CONST_FUN_OBJ_1(str_isupper_obj);
MP_DECLARE_CONST_FUN_OBJ_1(str_islower_obj);
MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(bytes_decode_obj);
#endif // MICROPY_INCLUDED_PY_OBJSTR_H