On 8/24/2020 12:15 PM, Raihan Rasheed Apurbo wrote:
I know that.... but do we need exact reference counting in any other case? what 
if we find out exact value just before entering GC and rest of the time use 
deferred value so that we can get rid of some addition subtraction operation 
during normal byte code execution. Is this possible? If not why so?

There are string optimizations that check if the reference count is exactly one. One such optimization is +=. See https://github.com/python/cpython/blob/master/Objects/unicodeobject.c#L2005 for the test.

Eric
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/72OUSL22IZZYG7QUGXUCLBIFFHGJ5EZJ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to