Message108312
Thanks for the input. I'm going to re-work the patch a bit (releasing buffers and such) and add a test within the next few days.
The question remains whether or not to accept other buffers with itemsize == 1. The way I understand it, fromstring already accepted any read-only buffer object, no matter the item size / whether it actually makes sense to call it a "string". I don't think accepting a hypothetical read-only buffer with items wider than 1 in fromstring (yes, bad naming) is desirable behaviour - I see a few options on how to deal with input validation:
1. ignore the item size. This'd be similar to current behaviour, plus r/w buffers
2. only accept byte-based buffers. ("things that look like 'const char*'") - this is what I've been aiming at.
3. only accept bytes and bytearray, and let the user think about how to deal with other objects. Question is - shouldn't array('B') be treated like bytearray in this respect? |
|
Date |
User |
Action |
Args |
2010-06-21 20:09:51 | tjollans | set | recipients:
+ tjollans, terry.reedy, belopolsky, pitrou, vstinner |
2010-06-21 20:09:51 | tjollans | set | messageid: <1277150991.51.0.563306853587.issue8990@psf.upfronthosting.co.za> |
2010-06-21 20:09:50 | tjollans | link | issue8990 messages |
2010-06-21 20:09:49 | tjollans | create | |
|