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/2014-August/135794.html below:

Minor API improvements for bytes & bytearray

[Python-Dev] PEP 467: Minor API improvements for bytes & bytearray [Python-Dev] PEP 467: Minor API improvements for bytes & bytearrayVictor Stinner victor.stinner at gmail.com
Fri Aug 15 21:59:40 CEST 2014
2014-08-15 21:54 GMT+02:00 Serhiy Storchaka <storchaka at gmail.com>:
> 15.08.14 08:50, Nick Coghlan написав(ла):
>> * add bytes.zeros() and bytearray.zeros() as a replacement
>
> b'\0' * n and bytearray(b'\0') * n look good replacements to me. No need to
> learn new method. And it works right now.

FYI there is a pending patch for bytearray(int) to use calloc()
instead of malloc(). It's faster for buffer for n larger than 1 MB:
http://bugs.python.org/issue21644

I'm not sure that the optimization is really useful.

Victor
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