Pure python interval calculations