The str/bytes Nightmare Before the Python 2 EOL


Before the EOL of python2, let's reflect one of the most well-known nightmare: str. This talk will analyze the nightmare, and provide the treatment for it. This is the right talk for you if you have encountered UnicodeEncodeError but not knew about the root cause yet. After the talk, you will know the difference between str and bytes in both python2 and python3 and learn the cleaner way to write string.

* This talk will organize many previous PyCon talks with real world supporting python3 experiences.


The talk is a review of **python string** in python2 and python3. The audience is basically expected to learn the string design concept in python, such as the fundamental change of string in python3, and why python2 string design was different. Additionally, audience could learn the best practice to write python string. If you want to learn more before or after, below talks are related to the background: - [Ned Batchelder: Pragmatic Unicode, or, How do I stop the pain?]( - [Guido van Rossum: BDFL Python 3 retrospective]( - [Brett Cannon - How to make your code Python 2/3 compatible - PyCon 2015]( - [Writing Python 2/3 compatible code by Edward Schofield](



Kir Chou

A code monkey builds search services in Amazon jungle. This will be the 3rd year of his presence in PyCon TW.