Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment:

It is both space and time optimization.

Fred was a proponent of small pickle sizes in the past, so I am adding him to 
the nosy list.

I am not too keen on this to happen, though.  It just seemed more natural to me 
not to create an empty list to unpickle an empty set.

By the same logic, allowing set() as an alternative to set([]) in python code 
is "premature optimization".

The patched code is a bit cleaner than the original without goto's and 
unnecessary XDECREFs.  (I am not sure what the latest word on redundant 
initializations is, so I kept =NULLs intact.)

On the other hand collections.deque does not optimize empty case either.

----------
nosy: +fdrake
priority: normal -> low

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

Reply via email to