> 2. Will it be possible in Python 3.0 to do the following: > > >>> def dotimes(n, callable): > > for i in range(n): callable() > > >>> def block(): > > nonlocal i > for j in range(i): > print j, > print
dotimes seems ok and what is wrong with that function "block"? You do
not need to specify that i is "nonlocal", global i will be used.
>>> i=10
>>> def block():
for j in range(i):
print j,
print
>>> block()
0 1 2 3 4 5 6 7 8 9
Jiri
--
http://mail.python.org/mailman/listinfo/python-list
