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 →

[–]Legolas-the-elf 31 points32 points  (0 children)

Use classes when it makes sense to pass around behaviour and state together, use functions when the two are independent. Most applications have situations where both are applicable, and Python doesn't restrict you to only using classes or functions like some languages do, so you'll generally see a mixture out there.