only accept str and array.array; removed inaccurate old comment