Arnaud Delobelle wrote: > "andrew cooke" <and...@acooke.org> writes: >> Arnaud Delobelle wrote: >>> class MyInt(int): >>> for op in binops: >>> exec binop_meth % (op, op) >>> for op in unops: >>> exec unop_meth % (op, op) >>> del op >> >> what's the "del" for? > > Without it, 'op' would end up as a class attribute.
ah! ok, that makes sense, i guess. thanks. (i just tried it out and you're right, of course, but also if binops and unops are empty you get an error, although i guess that's no an issue here). andrew -- http://mail.python.org/mailman/listinfo/python-list