In Python 3,$_{5 / 2 == 2.5}$ and not$_{2}$ ; all division between$_{int}$ values result in a$_{float}$ . This change has actually been planned since Python 2.2 which was released in 2002. Since then users have been encouraged to add from __future__ import division to any and all files which use the$_{/}$and$_{//}$ operators or to be running the interpreter with the -Q flag. If you have not been doing this then you will need to go through your code and do two things: The reason that / isn’t simply translated to // automatically is that if an object defines a __truediv__ method but not __floordiv__ then your code would begin to fail (e.g. a user-defined class that uses / to signify some operation but not$_{//}$ for the same thing or at all). In Python 2 you could use the$_{str}$ type for both text and binary data. Unfortunately this confluence of two different concepts could lead to brittle code which sometimes worked for either kind of data, sometimes not. It also could lead to confusing APIs if people didn’t explicitly state that something that accepted str accepted either text or binary data instead of one specific type. This complicated the situation especially for anyone supporting multiple languages as APIs wouldn’t bother explicitly supporting$_{unicode}$ when they claimed text data support. To make the distinction between text and binary data clearer and more pronounced, Python 3 did what most languages created in the age of the internet have done and made text and binary data distinct types that cannot blindly be mixed together (Python predates widespread access to the internet). For any code that deals only with text or only binary data, this separation doesn’t pose an issue. But for code that has to deal with both, it does mean you might have to now care about when you are using text compared to binary data, which is why this cannot be entirely automated. To start, you will need to decide which APIs take text and which take binary (it is highly recommended you don’t design APIs that can take both due to the difficulty of keeping the code working; as stated earlier it is difficult to do well). In Python 2 this means making sure the APIs that take text can work with$_{unicode}$ and those that work with binary data work with the$_{bytes}$type from Python 3 (which is a subset of$_{str}$ in Python 2 and acts as an alias for $_{bytes}$type in Python 2). Usually the biggest issue is realizing which methods exist on which types in Python 2 & 3 simultaneously (for text that’s$_{unicode}$ in Python 2 and$_{str}$ in Python 3, for binary that’s$_{str}$/$_{bytes}$in Python 2 and$_{bytes}$ in Python 3). The following table lists the unique methods of each data type across Python 2 & 3 (e.g., the$_{decode()}$ method is usable on the equivalent binary data type in either Python 2 or 3, but it can’t be used by the textual data type consistently between Python 2 and 3 because$_{str}$ in Python 3 doesn’t have the method). Do note that as of Python 3.5 the$_{__mod__}$ method was added to the bytes type. Making the distinction easier to handle can be accomplished by encoding and decoding between binary data and text at the edge of your code. This means that when you receive text in binary data, you should immediately decode it. And if your code needs to send text as binary data then encode it as late as possible. This allows your code to work with only text internally and thus eliminates having to keep track of what type of data you are working with. The next issue is making sure you know whether the string literals in your code represent text or binary data. You should add a$_{b}$prefix to any literal that presents binary data. For text you should add a$_{u}$prefix to the text literal. (there is a$_{__future__}$ import to force all unspecified literals to be Unicode, but usage has shown it isn’t as effective as adding a$_{b}$ or$_{u}$ prefix to all literals explicitly) 4 Text data Binary data decode encode format isdecimal isnumeric Text versus binary data Division 1. Add from __future__ import division to your files 2. Update any division operator as necessary to either use // to use floor division or continue using / and expect a float