2014-08-15 21:54 GMT+02:00 Serhiy Storchaka <storch...@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 _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com