classes in python Flashcards
methods
a function that belongs to a certain object - the functions that can be found within one class are also referred to as “methods”
instances
an object of a certain class; a copy of the class with actual values plugged in
__init__ method
used for setting the default state of an instance; also known as the constructor
objects
anything in a python program is an object. each object has a type, such has string, int, list, etc.
classes
templates for creating python objects
class variables
variables created inside of a class but outside of any method
are init methods a type of instance method?
no
inheritance
defining a class that inherits everything from another class
parent class/base class: class that is being inherited from
child class/derived class: class that inherits the functions and properties
overriding
when the child class replaces the value of something defined in the parent class
(similar IDs in css overriding the properties of a class)