[Python-Dev] PEP 467: last round (?)

Ethan Furman ethan at stoneleaf.us
Fri Sep 2 19:44:08 EDT 2016


On 09/01/2016 04:07 PM, Victor Stinner wrote:
> 2016-09-02 0:04 GMT+02:00 Ethan Furman:

>> - `fromord` to replace the mistaken purpose of the default constructor
>
> To replace a bogus bytes(obj)? If someone writes bytes(obj) but expect
> to create a byte string from an integer, why not using bchr() to fix
> the code?

The problem with only having `bchr` is that it doesn't help with `bytearray`; the problem with not having `bchr` is who wants to write `bytes.fromord`?

So we need `bchr`, and we need `bytearray.fromord`; and since the major difference between `bytes` and `bytearray` is that one is mutable and one is not, `bytes` should also have `fromord`.

--
~Ethan~


More information about the Python-Dev mailing list