Jeff wrote: > # Generic counter > def counter(min=None, max): > if not min: > min = 0 > for i in xrange(min, max): > yield i > i = i + 1 > Just for the record: >>> # Generic counter ... def counter(min=None, max): ... if not min: ... min = 0 ... for i in xrange(min, max): ... yield i ... i = i + 1 ... File "<stdin>", line 2 SyntaxError: non-default argument follows default argument
You'd have to add a little more parameter-checking for this to work like you intend. /W -- http://mail.python.org/mailman/listinfo/python-list