News for hackers. Stuff that matters.
Re:Grokking Python 3’s str by arundelo on Saturday January 14, 2017 @11:24AM (#13399079)
(pro tip: a b'foo' object in Python2.7 or Python3 isn't "a bytes", it's "a bytestring".)

Quotes from the Python 3 documentation:

Bytes literals are always prefixed with 'b' or 'B'; they produce an instance of the bytes type instead of the str type.

class bytes([source[, encoding[, errors]]])

Return a new “bytes” object, which is an immutable sequence of integers in the range 0 <= x < 256. bytes is an immutable version of bytearray – it has the same non-mutating methods and the same indexing and slicing behavior.

https://docs.python.org/3/library/functions.html#bytes

https://docs.python.org/3/reference/lexical_analysis.html#st...

Re:Grokking Python 3’s str by d0mine on Saturday January 14, 2017 @03:11PM (#13400304)
"bytes" is the type for bytestrings on both Python 2 and 3.