I have been programming for quite a while in Python but have just started to learn OOP properly. I find it really confusing and I don't really understand it. Especially the implicit self that python automatically passes. It just isn't clicking, really. May someone provide an easy explanation of what classes and objects are in general and how they are used in Python?

Recommended Answers

Here is a long video tutorial about this.

Jump to Post

All 2 Replies

Class in a nutshell ...
a class combines a number of methods/functions that belong together. A class can be passed to another class to inherit it's behavior.

A class definition is just code running in a namespace.

commented: Other than changing "class definition" to "class implementation" on th last line, works for me! :-) +12
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.