Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Checklist for dropping Python-2 support
* Remove all occurences of `# -*- coding: utf-8 -*-`.
* Remove all imports `unicode_literals`.
* Search for all occurences of `super(MyClass, self).` and replace by `super()`. **Check for grandparent super()!**.
* Search for all occurences of `six` and remove compatibility checks.
* Replace `ugettext` by `gettext`.
* Search for all occurences of `@python_2_unicode_compatible` and remove it.
* Search for all occurences of `__unicode__` and replace by `__str__`.
* Search for all occurences of `__nonzero__` and replace by `__bool__`
* Replace `from django.conf.urls import url` by `from django.urls import re_path`.
* Remove inheritance from `...(object)`.
* Replace `from django.forms.fields import EMPTY_VALUES` against `from django.core.validators import EMPTY_VALUES`.
* Replace all occurences of `force_text` by `force_str`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment