Ben Finney wrote:

> John Salerno <[EMAIL PROTECTED]> writes:
>
>> num = 33
>> 
>> for x in xrange(10):
>>     print num += 1
>
> Which is better done by 'num += 10'.
>
> Can you come up with an example that isn't trivially replaced with
> clearer code? That might make it clearer what your concern is.

::sigh:: No, unfortunately I don't have a strong enough grasp of Python
to give a really in-depth example. I understand what you're asking
though. Perhaps people don't use this idiom as much as I think they do,
so to give a trivial example to support my point isn't helpful.

As far as I know, though, I think this is used often enough, so I
thought I'd just ask if there are purists out there who don't like this
use of the loop and feel it's an abuse of the syntax.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to