Skip to content

Latest commit

 

History

History

README.md

Inheritance

This project aims to learn about inheritance, superclass, baseclass and subclass in Python.

Technologies

  • Python Scripts are written with Python 3.4.3
  • C files are compiled using gcc 4.8.4
  • Tested on Ubuntu 14.04 LTS

Files

Filename Description
0-lookup.py Function that returns the list of available attributes and methods of an object
1-my_list.py Class MyList that inhertis from list
2-is_same_class.py Function that returns True if the object is exactly an instance of the specified class; otherwise False
3-is_kind_of_class.py Function that returns True if the object is an instance of, or if the object is an instance of a class that inherited from, the specified class
4-inherits_from.py Function that returns True if the object is an instance of a class that inherited from the specified class
5-base_geometry.py Empty class BaseGeometry
6-base_geometry.py Class BaseGeometry with public instance method def area(self):
7-base_geometry.py Class BaseGeometry with public instance method that verifies if the input arg is an integer
8-rectangle.py Class Rectangle that inhertis from BaseGeometry
9-rectangle.py Class Rectangle that inhertis from BaseGeometry, with area() method implemented
10-square.py Class Square that inherits from Rectangle
11-square.py Class Square that inherits from Rectangle, with str() method
100-my_int.py Class MyInt that inhertis from int. Its == and != operators are inverted
101-add_attribute.py Function that adds a new attribute to an object if it's possible