Last active
February 2, 2021 14:27
-
-
Save jrief/0e6b97be132452a511eae81d54ca01ae to your computer and use it in GitHub Desktop.
Checklist for dropping Python-2 support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* 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