Raymond Hettinger <[email protected]> added the comment:
I think the patch is correct.
FWIW, my style is to prebind the next method, making the counter completely
self-contained (like a closure):
+_counter = itertools.count().next
def _newname(template="Thread-%d"):
global _counter
- _counter = _counter + 1
- return template % _counter
+ return template % _counter()
----------
assignee: -> rhettinger
nosy: +rhettinger
resolution: -> accepted
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue11866>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com