OOP Vocab Flashcards
Object
An instance of a thing
Instance
What you get when you tell python to use class blue print to make a thing
Self
Inside the functions in a class. Self is a variable that holds a space for the instance/object being accessed.
Is-a
A phrase to say something inherits something from another class
Has-a
A phrase to say something is composed of other things
Class x(y)
Make a class named x that is-a y
Class x(object): def __init__(self, j)
Class x has-a __init__ that takes self & j parameters
Class x(object): def m(self, j)
Class x has-a function named m that takes self & j as parameters
Foo = x()
Set foo to an instance of class x
Foo.m(j)
From foo get the m function & call it with parameters self & j
Foo.k = q
From foo get the k attribute and set it to q
Class
Python makes a new type of thing