[Python-ideas] Fixing the Python 3 bytes constructor

Guido van Rossum guido at python.org
Thu Apr 3 22:17:54 CEST 2014


Actually, I hadsn't thought about that much, it's fine to only have
bytes.byte().


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/20140403/0bfbf2d2/attachment.html>


More information about the Python-ideas mailing list