Petr Viktorin wrote:
> Should we care about hacks/optimizations that rely on having the only 
> reference (or all references), e.g. mutating a tuple if it has refcount 
> 1? Immortal objects shouldn't break them (the special case simply won't 
> apply), but this wording would make them illegal.
> AFAIK CPython uses this internally, but I don't know how 
> prevalent/useful it is in third-party code.

For what it's worth Cython does this for string concatenation to concatenate in 
place if possible (this optimization was copied from CPython). It could be 
disabled relatively easily if it became a problem (it's already CPython only 
and version checked so it'd just need another upper-bound version check).
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/CDNQK5RMXSLLYFNIXRORL7GTKU6B4BVR/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to