[Python-ideas] Fixing the Python 3 bytes constructor
Nick Coghlan
ncoghlan at gmail.com
Thu Apr 3 23:49:58 CEST 2014
On 4 Apr 2014 06:18, "Guido van Rossum" <guido at python.org> wrote:
>
> Actually, I hadsn't thought about that much, it's fine to only have
bytes.byte().
Oh, cool, I guess I *should* have argued about that one :)
Cheers,
Nick.
>
>
> On Thu, Apr 3, 2014 at 1:04 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
>>
>>
>> On 4 Apr 2014 05:03, "Serhiy Storchaka" <storchaka at gmail.com> wrote:
>> >
>> > 02.04.14 14:40, Nick Coghlan написав(ла):
>> >
>> >> I thought of that, but it seems like a recipe for typos and confusion.
>> >> bytes.byte and bytearray.byte seem clearer and safer.
>> >
>> >
>> > bytearray.byte looks deceptive. It returns not a byte, but 1-element
bytearray.
>> >
>> > I doubt that creating 1-element bytearray is enough often case to add
new special method (unlike to bytes.byte).
>>
>> I actually agree, but Guido preferred the greater API consistency. Since
I'm only -0 on bytearray.byte, I don't have much motivation to argue about
it.
>>
>> Cheers,
>> Nick.
>>
>> >
>> >
>> > _______________________________________________
>> > Python-ideas mailing list
>> > Python-ideas at python.org
>> > https://mail.python.org/mailman/listinfo/python-ideas
>> > Code of Conduct: http://python.org/psf/codeofconduct/
>>
>>
>> _______________________________________________
>> Python-ideas mailing list
>> Python-ideas at python.org
>> https://mail.python.org/mailman/listinfo/python-ideas
>> Code of Conduct: http://python.org/psf/codeofconduct/
>
>
>
>
> --
> --Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140404/fa331d8f/attachment.html>
More information about the Python-ideas
mailing list