Re:In CPython, types implemented in C are part of the type tree
by chrismorgan on Thursday December 24, 2020 @02:59PM
(#25530892)
Thanks for the correction; it’s about five years since I’ve done any serious work in Python, and six or seven since I last did any involved metaprogramming, and I assiduously avoided old-style classes even then, and so I had completely forgotten about types.ClassType. Python 2.4 was the oldest version I ever worked with, also.
As a minor note, in Python 2, types.ClassType was a "thing":
I don't remember the details any more, but it looks like it was the base for class for old-style classes. Using your class definitions: Python 3 replaced that functionality with types.new_class(), which returns an instance of type 'type': As I recall, in the early 1.x days it wasn't apparent that the class/type dichotomy was a problem. It took a lot of work during the 2.x era to bring them together.