Home > Articles > Open Source > Python

  • Print
  • + Share This
Like this article? We recommend

Like this article? We recommend

Class Changes

Prior to version 2.2, one flaw in Python's objects is that they didn't behave like classes in other languages: Classes were class objects and instances were instance objects, in stark contrast to what most people perceive as "normal" (classes are types and instances are objects of such types). With this approach, you couldn't subclass data types and modify them.

In 2.2, the core development team came up with "new-style classes" that act more like what people expect. Furthermore, regular Python types could now be subclassed. This change is described in van Rossum's "Unifying Types and Classes in Python 2.2." Python 3.0 only supports these new-style classes.

  • + Share This
  • 🔖 Save To Your Account