On Sat, 10 Oct 2020 at 19:28, Tim Peters <tim.pet...@gmail.com> wrote:
> Try to spell out what you mean - precisely! - by "this". I can't do
> that for you. For any plausible way of fleshing it out I've thought
> of, the answer is "no".

Well, please, don't be so harsh. I'm trying to discuss to someone that
co-created Python itself, it's not simple to me :-P

> The closest you can get to BigDecimal's behavior "by magic" in Python
> is to set the context precision to its maximum allowed value.

I think there's another "trick" to get the BigDecimal behaviour.
If you read the Javadoc, it says that each operation has a default
precision. For example, multiplication a*b has precision = a_scale +
b_scale. So, in reality, also BigDecimal has a context with finite
precision. The difference is that the default context has a variable
precision, depending on the operation.

Could Python decimal have something similar, maybe by setting prec = -1?
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/O7KUARDPTMJ36FEYJTKGEUPHFG3A5BOG/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to