Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

I have two options for solving this result.

1. Add necessary checks for the list case. This will add a bunch of code and 
will slow down handling all lists because of additional checks.

2. Use the optimization for lists only when there are no other references to 
it. If no other references, the list can not be changed. This will not add much 
code, and may even slightly speed up cases for tuples and lists. But the code 
will be more fragile.

Of course there is an option of removing this optimization at all. But 
bytes([x]) and bytes((x,)) are common cases.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34973>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to