Strings and Bytes

Joannah Nanjekye · Apress eBooks · 2017

Python 3 created a clear distinction between bytes and text, as opposed to Python 2 that uses the str type for both text and bytes. Python 2’s idea of the str type led to a scenario where code worked for either type of data, or sometimes none. On the other hand, Python 3 requires that you care about when you are using text (as compared to binary data). This chapter describes how to absorb these differences in a single code base that can run in both Python versions. First, let’s look at these differences.

Read the paper · More papers on PaperTik