#NEWLINE# @ ComparisonBenchmark ( 'Calculate Savings' , classname = 'Person' , timeit_number = 100 , validation = True , largs = ( 55 , ) , kwargs = { #NEWLINE# #INDENT# 'monthly_spending' : 500 , #NEWLINE# #UNINDENT# } ) #NEWLINE# def calculate_savings_method2( self , retirement_age , monthly_spending = 0 ) : #NEWLINE# #INDENT# yearly_income = ( 12 * ( self . monthly_income - monthly_spending ) ) #NEWLINE# n_years = ( retirement_age - self . age ) #NEWLINE# if ( n_years > 0 ) : #NEWLINE# #INDENT# return ( yearly_income * n_years )