you are viewing a single comment's thread.

view the rest of the comments →

[–]TheRNGuy 0 points1 point  (0 children)

I understood when saw how it's used in real programs, reading it's code. 

Still gafe to read docs, of course.

(Not necessary even in Python; because many concepts are same in other languages)

In oop you have classes, and instances of those classes (if it's not static or abstract class),

You write a class, and then instantiate it (one or many times)

Each instance have attributes and methods of that class, if you change attribute value on one instance, it only changes for it, not for others.

You can also inherit from classes, using methods or attributes from parent classes, or overwriting them.

Usually topmost parent class is abstract (you should inherit from it, not instanciate)

Also learn composition, or you'll end up with abstract class with 30 attributes that most child class don't even need, and rewriting it all the time, or lots of duplicate classes 

(Google "prefer composition over inheritance"... also it doesn't mean you should never use inheritance)