Level 96 Level 98
Level 97

Object Oriented


34 words 0 ignored

Ready to learn       Ready to review

Ignore words

Check the boxes below to ignore/unignore words, then click save at the bottom. Ignored words will never appear in any learning session.

All None

Ignore?
OO
object-oriented
OOP
ject-Oriented Programming
Class
prototype defining a set of attribute that characterize objects of the class
Class variable
variable shared by all instances of a class. Defined within a class but outside class's methods
Data member
A class variable or instance variable that holds data associated with a class and its objects
Function overloading
the assignment of more than one behavior to a particular function
Instance variable
A variable that is defined inside a method and belongs only to the current instance of a class
Inheritance
the transfer of the characteristics of a class to other classes
Instance
An individual object of a certain class
Instantiation
the creation of an instance of a class
Method
A special kind of function that is defined in a class definition
Object
A unique instance of a data structure
Operator overloading
the assignment of more than one function to a particular operator
class class_name: statement
Creating Classes
class_name.__doc__
the class has a documentation string, which can be accessed via
__init__()
a special method, which is called class constructor or initialization method that Python calls when you create a new instance of this class
getattr(obj, name[, default])
access the attribute of object
hasattr(obj, name)
check if an attribute exists or not
setattr(obj, name, value)
set an attribute. If attribute does not exist, then it would be created
delattr(obj, name)
delete an attribute
__dict__
Dictionary containing the class's namespace.
__doc__
Class documentation string or none, if undefined.
__name__
Class name.
__module__
Module name in which the class is defined. This attribute is "__main__" in interactive mode.
__bases__
A possibly empty tuple containing the base classes, in the order of their occurrence in the base class list.
del object
Destroying Objects (Garbage Collection)
__del__()
special method called destructor to destroy an instance
issubclass(sub_class, sup_class)
Checks a relationships of two classes and instances
isinstance(obj, class_name)
returns true if obj is an instance of class Class or is an instance of a subclass of Class
obj = className(args)
Constructor (with any optional arguments)
del obj
Destructor, deletes an object (obj)
repr(obj)
Evaluatable string representation
str(obj)
Printable string representation
cmp(obj, x)
Object comparison