Use member names to initialize PyTypeObjects by radarhere · Pull Request #8741 · python-pillow/Pillow

Borrowing an idea from #5201. Similar to #8734

As shown at https://docs.python.org/3/c-api/typeobj.html#examples, this uses member names to initialize PyTypeObjects, rather than being verbose and going through every member in sequence.

Also, I've removed specifying tp_flags as Py_TPFLAGS_DEFAULT, and so instead using the actual default from https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_flags, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE.

https://docs.python.org/3/c-api/typeobj.html#c.Py_TPFLAGS_BASETYPE

Py_TPFLAGS_BASETYPE
This bit is set when the type can be used as the base type of another type. If this bit is clear, the type cannot be subtyped (similar to a “final” class in Java).

I don't think we really need to specify that they can't be subtyped.