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/2009-April/088790.html below:

[Python-Dev] Why does read() return bytes instead of bytearray?

[Python-Dev] Why does read() return bytes instead of bytearray? [Python-Dev] Why does read() return bytes instead of bytearray?Antoine Pitrou solipsis at pitrou.net
Thu Apr 16 01:16:29 CEST 2009
Lisandro Dalcin <dalcinl <at> gmail.com> writes:
> 
> However, your original question is still valid ... Why a binary read()
> returns an immutable type?

Because bytes is the standard type for holding binary data. Bytearray should
only be used when there's a real, measured performance advantage doing so
(which, IMHO, is rarer than you think). An immutable type makes daily
programming much less error-prone.

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