Python Forum
bytearray (and bytes) in Python2 - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: bytearray (and bytes) in Python2 (/thread-18877.html)



bytearray (and bytes) in Python2 - Skaperen - Jun-05-2019

i read in a couple places that bytearray is not available in Python 2. my Python 2.7.12 in Ubuntu 16.04.6 does have bytearray. was this added at some value of x in 2.x? also, the type bytes exists in 2.7.12 as an alias of str (bytes == str and bytes is str -> True). when was this alias added? i want to get the reference in some documentation to be correct.


RE: bytearray (and bytes) in Python2 - Gribouillis - Jun-05-2019

The official documentation, which you can read profitably, reveals that bytes and bytearray were added in python 2.6.


RE: bytearray (and bytes) in Python2 - Skaperen - Jun-05-2019

i didn't want to be hitting or downloading so many different versions.


RE: bytearray (and bytes) in Python2 - heiner55 - Jun-06-2019

Or see here:
https://stackoverflow.com/questions/1740696/bytes-vs-bytearray-in-python-2-6-and-3