cleaner way to write this try/except statement?
John Salerno
johnjsal at NOSPAMgmail.com
Wed Aug 2 09:50:28 EDT 2006
Simon Forman wrote:
> Maybe I did miss something: Are you actually trying to make a static
> method? Say, to be able to call it elsewhere than just the Validate()
> method?
I don't know if a static method is the best way to do it, but what I was
trying to do was make a regular function within the validator class, so
that I could call it whenever I needed to show that error message. I
suppose I could just use a regular method to do it, too, but it seems
more like a utility function than a method that requires 'self'.
My identation seems correct to me (and I get no errors about it), but
it's still not working the way I have it. Maybe I shouldn't mess with
decorators right now anyway...
More information about the Python-list
mailing list