Created
December 5, 2011 16:19
-
-
Save nkabir/1434148 to your computer and use it in GitHub Desktop.
alexhawat hw3 discount factor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class DiscountFactor(object): | |
| ''' | |
| class that holds a discount factor for a specified interval | |
| ''' | |
| ### DON'T NEED THIS | |
| #counter is a "Class Variable" for the number of created instances of DiscountFactor | |
| counter = 0 | |
| def __init__(self, ref_date, slice_date, factor): | |
| ''' | |
| Constructor | |
| ref_date: SerialDate object holding the reference date (start of interval) | |
| slice_date: SerialDate object holding the discount factor date/end of interval (or the date of the transfer) | |
| factor: float holding the discount factor | |
| ''' | |
| ### DON'T NEED TO CALL SUPER CONSTRUCTOR WHEN EXTENDING object | |
| super(DiscountFactor, self).__init__() | |
| ### PLEASE FOLLOW NAMING CONVENTION | |
| self.reference_date=ref_date | |
| self.discount_factor_date=slice_date | |
| self.factor=factor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment