[Python-3000] Fwd: Beta 3 planned for this Wednesday (OT: Beta 3 planned for this Wednesday)

Guido van Rossum guido at python.org
Fri Sep 5 19:37:03 CEST 2008


This needs to be fixed. It is surely a relic from the alpha1 situation
where the bytes type was mutable. No read APIs should return mutable
bytes. Write APIs should accept mutable and immutable bytes though.

On Fri, Sep 5, 2008 at 12:17 AM, Gregory P. Smith <greg at krypto.org> wrote:
> Anyone have an opinion on http://bugs.python.org/issue3492 in regards
> to it being a release blocker?
>
> The gist of it:  zlib returns bytearrays where other modules return
> bytes.  zipimport, because it uses zlib, required bytearrays instead
> of bytes as input.  A few other modules also appear to return
> bytearrays when they're likely better off returning bytes for
> consistency.
>
> IMHO, it seems like bytearrays should rarely be returned by the
> existing standard library apis.  Since they are mutable they are
> ideally suited for new APIs where they're passed in and modified.
>
> Whats the big deal if this is not fixed before release?  Users are
> likely to get frustrated at inputs not being hashable without explicit
> (data copy) conversion to an immutable type.  And any code that gets
> written depending on these returning bytearrays instead of bytes would
> need fixing if we waited until 3.1 to fix it.
>
> -gps
>
> On Wed, Sep 3, 2008 at 10:42 PM, Anand Balachandran Pillai
> <abpillai at gmail.com> wrote:
>> On Thu, Sep 4, 2008 at 10:47 AM, Gregory P. Smith <greg at krypto.org> wrote:
>>> I agree that this should go in.  zlib should return bytes.  other read
>>> functions and similar modules like bz2module already return bytes.
>>> unless i hear objections, i'll commit this in about 12 hours.
>>
>> +1  :)
>>
>>>
>>
>> Regards
>>
>> --
>> -Anand
>>
> _______________________________________________
> Python-3000 mailing list
> Python-3000 at python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe: http://mail.python.org/mailman/options/python-3000/guido%40python.org
>



-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list