Serhiy Storchaka added the comment:

The downside of this change:

1. The _RandomNameSequence iterator no longer has the rng field. But it isn't 
used in the stdlib. And since _RandomNameSequence is a private name, it 
shouldn't be used in third-party code.

2. The result of no longer copyable neither pickleable. This could cause a 
problem if it is set as an attribute of copyable of pickleable object. But it 
is used only as function local or module global instances in tempfile and class 
attribute of in multiprocessing.synchronize.SemLock and 
multiprocessing.heap.Arena. All these cases don't involved in copying or 
pickling. And in general copying and pickling the _RandomNameSequence object is 
a doubtful idea.

3. This makes iterating the _RandomNameSequence iterator slightly (about 6%) 
slower. Not a big deal, it isn't used in performance critical code. It is 
possible to speed up the _RandomNameSequence iterator by the same 6% by using 
functools.partial (functools already is imported in tempfile), but this makes 
the code slightly less clear, and I choose the simplicity of the code.

----------

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

Reply via email to