Martin v. Löwis added the comment:

For the record, format 3 was added through issue16475, format 4 was added 
through issue19219.

In msg175962, Kristjan argued that there is no reason _not_ to share int 
objects, e.g. across multiple code objects. Now it seems that this argument is 
flawed: there is a reason, namely the performance impact.

OTOH, I consider both use case (marshaling a large number of integers, and 
desiring to share ints across code objects) equally obscure: you shouldn't 
worry about marshal performance too much if you have loads of tiny int objects, 
and you shouldn't worry whether these ints get shared or not.

As a compromise, we could suppress the sharing for small int objects, since 
they are singletons, anyway. This would allow marshal to preserve/copy the 
object graph, while not impacting the use case that the original poster on 
python-dev presented.

----------

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

Reply via email to