[Python-Dev] Re: Optimizing literal comparisons and contains

2021年11月28日 18:12:28 -0800

On 2021年11月29日 00:52, Christopher Barker wrote:
I will frequently do simple computation with literals to make my code more clear:
t = 2 * 3600 # 2 hours in seconds
But I see no need to optimize this kind of thing -- it would never be in a tight loop.
The suggestion was specifically about optimising comparison of literals such as 1 < 2, which is not done at present, and the objection is basically YAGNI - that kind of thing is just too rare to be worth it.
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/2VS4ZPFYAYVOG4BBHRWAFIEH7CU62X4B/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to