class Employee():
    """
    An employee.
        eid: int        - This employee's ID number
        name: str       - This employee's name
        SIN: int        - This employee's social insurance number
        pay_period: str - This employee's pay period, either 'weekly' or
                          'monthly'
    
    This is an abstract class.  Only child classes should be instantiated.
    """
    
    def __init__(self, eid, name, SIN, pay_period):
        """
        (Employee) -> NoneType
        """
        
        self.eid = eid
        self.name = name
        self.SIN = SIN
        self.pay_period = pay_period
        self.pay_history ={}
        
        
    def amount_of_pay(self):
        """
        (Employee) -> float
        
        Return the amount that this Employee should be paid in the next
        pay period.
        """
        raise NotImplementedError('Implemented in a subclass')
        
    def record_pay(self, date):
        """
        (Employee, str) -> NoneType
        
        Record the amount this Employee should be paid for the next pay
        period in their pay history, with the associated date.
        """
        amount = self.amount_of_pay()
        self.pay_history[date] = amount
        
    def total_pay(self):
        """
        (Employee) -> float
        
        Return the total amount of pay this Employee has received.
        """
        
        ## Version 1: loop over the dictionary items and sum up
        ## the values.
        
        ## Version 2: loop over the dictionary items and make a list
        ## of the values.  Call sum on that.
        #pay_amount = []
        #for amount in self.pay_history.values():
            #pay_amount.append(amount)
        ## return sum(pay_amount)
        
        # Version 3:
        return sum(self.pay_history.values())
    

        
    
if __name__ == '__main__':
    import doctest
    doctest.testmod()