Classes and Special Methods in Python

These are my study notes on Classes and special methods. As always, if something is wrong then you can always correct me, it would help me and everybody else. Class ‘Employee’ example This is the example class that we’re going to use, a class Employee which we will inherit from to create more classes like Manager and Supervisor: class Employee(object): """Class simulating an Employee with basic attributes.""" total_employees = 0 def __init__(self, name, rate, position): self....

March 18, 2018 · 6 min · Franccesco Orozco