Message142016
| Author |
rhettinger |
| Recipients |
Peter.Saveliev, amaury.forgeotdarc, pitrou, rhettinger |
| Date |
2011年08月13日.07:52:09 |
| SpamBayes Score |
0.0010372987 |
| Marked as misclassified |
No |
| Message-id |
<1313221930.15.0.44981926948.issue11866@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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() |
|