Using a single letter (or short) variable name works well most of the time but has one problem: the variable can leak. It's easy to forget to write the del statement. Imagine a block statement that had the effect of deleting any variables initialized in the block. That is (using the with keyword in this example but there are other choices):
x = foo()
with:
y = x + 1
x = y + 2
is equivalent to:
x = foo()
y = x + 1
x = y + 2
del y
or after optimization:
x = (foo() + 1) + 2
[Obviously more useful with real code but this is sufficiently illustrative. Also I imagine someone might say it's just foo() + 3 but I don't know the type of foo().]
--- Bruce
--
--- Bruce
Check out my puzzle book and get it free here: