A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-October/113844.html below:

[Python-Dev] Using PEP384 Stable ABI for the lzma extension module

[Python-Dev] Using PEP384 Stable ABI for the lzma extension module [Python-Dev] Using PEP384 Stable ABI for the lzma extension moduleAntoine Pitrou solipsis at pitrou.net
Tue Oct 4 21:12:04 CEST 2011
On Tue, 4 Oct 2011 13:05:58 -0400
Nick Coghlan <ncoghlan at gmail.com> wrote:
> 
> > - _PyBytes_Resize() is missing; I moved it under a Py_LIMITED_API
> >  section.
> 
> No, that's not valid. Bytes are officially immutable - mutating them
> when the reference count is only 1 is a private for a reason. The
> correct way to do this without relying on that implementation detail
> is to use a byte array instead.

Uh, no, it depends what you're doing. There's no reason not to allow
people to resize a bytes object which they've just allocated and is
still private to their code. That's the whole reason why
_PyBytes_Resize() exists, and the use case is not exotic.

Telling people to "first create a bytearray and then create a bytes
object from that when you're finished" would be a shame.

Regards

Antoine.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4