Added support for bytes in sliced __setitem__#42
Conversation
|
Actually, I think since I rarely bytearays, and even less array.array, I guess, I just didn't though about it. To be even more general, I propose I replace by this if you think it's acceptable : ...I could also try to convert the list to bytes so that it does value checking too, but I don't want to impact the performance of existing code. What do you think about it ? By the way, If you are interested, I can also implement the Slice setitem for 16bit |
|
I think you can omit the isinstance check at all. It's not really needed if we want to be as generic as possible. In fact all that code really need is some iterable object that provide integers. So you can simply change check to something like:
and that will cover much more use cases. I just want you to make a proper test case when regular string is passed (e.g. "foo" not a byte string). |

All tests pass