Python – Object Oriented Programming – Design Inheritance & Properties

Best Practices Designing for Inheritance and Polymorphism Polymorphism   Interface

batch_withdraw() doesn’t need to check the object to know which withdraw() to call Liskov substitution principle Base class should be interchangeable with any of its subclasses without altering any properties of the program Wherever BankAccout woorks –> CheckingAccount should work as well Syntactically function […]

Python – Object Oriented Programming – Exceptions

Integration with Python Operator overloading : comparison Object equality

  Variables are references

Due to the fact how the objects and variables representing them are stored printing the value of the (customer) object –> prints the memory allocation chunk the value = reference to the memory chunk ))> so when comparing we are […]

Python – Object Oriented Programming – Class Inheritance

Inheritance and Polymorphism Instance and Class Data Core Principles of OOP Inheritance Extending functionality of existing code Polymorphism Creating an unified interface Encapsulation Bundling of data and Methods Instance-level data

name , salary are instance attributes self binds to an instance Class-level data

data shared among all instances of a class define class […]