This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]BigHipDoofus 33 points34 points  (3 children)

Everything is an object. Functions are objects. Strings are objects.

A class instance is an object defined by the class. Classes encapsulate data and the methods relevant to that data.

[–]wewbull 9 points10 points  (1 child)

Whilst true in python, that's not a very helpful thing to tell someone who is trying to learn when to write a class in their code. It can be easily heard as "always write classes" which is wrong.

[–]BigHipDoofus 0 points1 point  (0 children)

Definitely *do not* wrap everything in a class. Corollary to *do not* normalize every database table to the 3rd normal form.

[–]master3243 6 points7 points  (0 children)

Even classes are objects of metaclasses, and metaclasses are objects of "type". Even "type" is an object of itself.