An implementation of strtod in python