gunicorn icon indicating copy to clipboard operation
gunicorn copied to clipboard

refactor: remove python 2 new-style classes as only python 3.5+ is supported now

Open kkirsche opened this issue 2 years ago • 1 comments

In Python 2, there were different ways to create classes: the old and new style. gunicorn uses the new-style of class creation, which inherits from object. This difference is described here:

https://docs.python.org/2/reference/datamodel.html#new-style-and-classic-classes https://www.python.org/download/releases/2.2.3/descrintro/

As gunicorn supports Python 3.5+ at this time, the use of new-style classes can be removed as all classes in Python 3 are new-style classes by default.

kkirsche avatar Jul 27 '22 13:07 kkirsche

Updated version, with commits split for different cleanup: https://github.com/benoitc/gunicorn/compare/master...pajod:gunicorn:patch-py36

No harm in merge conflicts, can always be trivially regenerated thanks to https://pypi.org/project/pyupgrade/

pajod avatar Dec 09 '23 03:12 pajod