Moving from Python 2.7 to 3.x is covered in much more detail here. This list is just a list of items I’m checking as I make the switch. It’s somewhat reflective of my own coding style and is meant more as a checklist for myself than anything, but if it helps you, great!
raise, Execption "Message"to
from module import xto
from .module import x, if
moduleis a relative import and not on the PYTHONPATH. If I’m importing the entire module, it’s now
from . import module.
- Anywhere there is integer division being used, change it from
- If I use the result of
range(...)as a list, explicitly convert it to a list, e.g.,