Everything is an object in python - object class and type class

Marko Rauhamaa marko at pacujo.net
Wed Jun 3 04:57:33 EDT 2015


Steven D'Aprano <steve+comp.lang.python at pearwood.info>:

> On Wednesday 03 June 2015 08:33, Marko Rauhamaa wrote:
>> In Python, classes are little more than constructor functions.
>
> [...]
>
> Classes give you an inheritance hierarchy.

That's encapsulated in the constructor. From the class user's point of
view, it doesn't matter if the object derives its behavior through
inheritance or through reimplementation. From the class implementor's
point of view, inheritance is syntactic sugar.

> They also hold shared state, and behaviour for the instances.

That's the "little more" I was referring to. It is Python esoterics
that can safely be ignored.


Marko



More information about the Python-list mailing list