Raymond Hettinger added the comment:
The reason that this comment was added was to note the recipes themselves are unoptimized and to provide some guideance on how that could be done. The recipes themselves are provided in the cleaner looking form.
FWIW, localizing variables is one of the few code optimizations available to python programmers. It is not uncommon in the standard library eventhough there are some people who just don't like it (including apparently the OP).
Sorry Chris, I'm going to reject this. The note is correct, the optimization is valid, and so is the original purpose for adding it.
resolution: -> not a bug
stage: -> resolved
status: open -> closed