On 12 January 2017 at 09:04, George Fischhof <geo...@fischhof.hu> wrote: > Hi There, > > Settable defaulting to decimal instead of float > > It would be good to be able to use decimal automatically instead of float if > there is a setting. For example an environment variable or a flag file. > > Where and when accuracy is more important than speed, the user could set > this flag, and calculate with decimal numbers as learned in the school. > > I think several people would use this function > > Best regards, > George
If by "defaulting" you mean having floating point literals default to decimal, this has been discussed before and would break a lot of code, so is realistically not going to happen. If that's not what you mean, pretty much everything else can be done in your code (use "Decimal()" in place of "float()", etc). It's unlikely that there's a practical suggestion here that hasn't been discussed before and rejected, but if you have something specific to suggest, then you'll have to clarify your proposal with a lot more detail. But I wouldn't bother unless you can also demonstrate that your proposal avoids breaking backward compatibility (and "users can choose whether to use it via a flag" isn't sufficient - it doesn't help library modules for instance) as it will have no chance of being accepted unless it's backward compatible. Regards, Paul _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/