Or better yet, define your own string/class exception to catch your
errors. In my code, things can break in more than a few ways. In each
case I catch the exception(s) specific to that piece of code, print a
warning message to the user at sys.stdout and raise a new exception to
be caught by my "w
Vikram wrote:
I can't use 'break' or 'continue' in a class method, nor can I return a
boolean value from __init__() to check for errors within the for-loop.
How would I be able to stop the current iteration and continue with the
next after reporting an error?
maybe i don't fully understand your qn
Exactly the answer I was looking for! 12 hours of straight programming
tends to fog ones mind. Thanks for making it clear!
Jay
--
http://mail.python.org/mailman/listinfo/python-list
> I can't use 'break' or 'continue' in a class method, nor can I return a
> boolean value from __init__() to check for errors within the for-loop.
> How would I be able to stop the current iteration and continue with the
> next after reporting an error?
maybe i don't fully understand your qn but w
NavyJay wrote:
I have a simple for-loop, which instantiates a class object each
iteration. As part of my class constructor, __init__(), I check for
valid input settings. If there is a problem with this iteration, I
want to abort the loop, but equivalently 'continue' on in the for-loop.
I can't us
I have a simple for-loop, which instantiates a class object each
iteration. As part of my class constructor, __init__(), I check for
valid input settings. If there is a problem with this iteration, I
want to abort the loop, but equivalently 'continue' on in the for-loop.
I can't use 'break' or '