@asmeurer i cannot do that because newf is still None and rewrite for Nonetype is not defined and ultimately we are replacing f with newf 
just before return statement we have :
self.fa, self.fd = frac_in(self.newf, self.t)

Why not we change f in beginning itself for trigonometric functions as its currently there is no possible way out for such functions ?