Message270973
I am torn on this. On one hand, it would be good to be consistent with the single-argument behaviour. But on the other hand, APIs normally accept arbitrary bytes-like objects (like memoryview) to minimise unnecessary copying, whereas this case has to make a copy to append a null terminator.
Perhaps another option is to deprecate int(byteslike) support instead, in favour of explicitly making a copy using bytes(byteslike). Similarly for float, compile, eval, exec, which also do copying thanks to Issue 24802. But PyNumber_Long() has called PyObject_AsCharBuffer() (predecessor of Python 3’s bytes-like objects) since 1.5.2 (revision 74b7213fb609). So this option would probably need wider discussion. |
|
Date |
User |
Action |
Args |
2016-07-22 07:17:19 | martin.panter | set | recipients:
+ martin.panter, xiang.zhang |
2016-07-22 07:17:19 | martin.panter | set | messageid: <1469171839.37.0.208972079329.issue27572@psf.upfronthosting.co.za> |
2016-07-22 07:17:19 | martin.panter | link | issue27572 messages |
2016-07-22 07:17:18 | martin.panter | create | |
|