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/135793.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 & bytearraySerhiy Storchaka storchaka at gmail.com
Fri Aug 15 21:54:22 CEST 2014
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.

> * add bytes.iterbytes(), bytearray.iterbytes() and memoryview.iterbytes()

What are use cases for this? I suppose that main use case may be writing 
the code compatible with 2.7 and 3.x. But in this case you need a 
wrapper (because these types in 2.7 have no the iterbytes() method). And 
how larger would be an advantage of this method over the 
``map(bytes.byte, data)``?


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