- Class:
- A user-defined prototype for an object that
defines a set of attributes that characterize any object of the
class. The attributes are data members (class variables and instance
variables) and methods, accessed via dot notation.
class course:
-
Class variable:
- A variable that is shared by all instances
of a class. Class variables are defined within a class but outside any
of the class's methods. Class variables are not used as frequently as
instance variables are.
count = 0
classes = []
-
Data member:
- A class variable or instance variable that holds
data associated with a class and its objects.
count = 0
self.count = self.__class__.count
or
self.count = course.count
-
Function overloading:
- The assignment of more than one
behavior to a particular function. The operation performed varies by
the types of objects or arguments involved.
def __init__(self, title, dept):
-
Instance variable:
- A variable that is defined inside a method
and belongs only to the current instance of a class.
self.title = title
-
Inheritance:
- The transfer of the characteristics of a class
to other classes that are derived from it.
class gradcourse(course):
def __init__(self, title, dept):
course.__init__(self, title, dept)
self.grad = True
-
Instance:
- An individual object of a certain class. An object
obj that belongs to a class course, for example, is an instance of the
class course.
c = course("CS200", "Computer Science")
-
Instantiation:
- The creation of an instance of a class.
c = course("CS200", "Computer Science")
-
Method:
- A special kind of function that is defined in a class
definition.
def add_student(self, item):
-
Object:
- A unique instance of a data structure that's defined
by its class. An object comprises both data members (class variables
and instance variables) and methods.
c = course("CS200", "Computer Science")
-
Operator overloading:
- The assignment of more than one function
to a particular operator.
a = 1 + 2
b = "hello " + "world"