Author serhiy.storchaka
Recipients haypo, pitrou, rhettinger, serhiy.storchaka
Date 2017-04-10.16:16:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491841000.68.0.87381756235.issue30030@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-04-10 16:16:40serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, pitrou, haypo
2017-04-10 16:16:40serhiy.storchakasetmessageid: <1491841000.68.0.87381756235.issue30030@psf.upfronthosting.co.za>
2017-04-10 16:16:40serhiy.storchakalinkissue30030 messages
2017-04-10 16:16:40serhiy.storchakacreate