Phillip B Oldham wrote:
I'm building an RPC service, and I need to validate the input and
provide informative error messages to users. What would be the best
way to do this? Simple `if` statements each raising a custom
exception? `assert` statements inside a try/except block to
"translate" the assertion errors into something more meaningful?

Use 'if'. Asserts are for debugging program logic (and hence can be optimized away), not for user input.

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to