From: Yuri T. <qar...@gm...> - 2008-02-26 08:39:39
|
> Is there any reason nothing explicitly raises exceptions? I've uses > sys.exit() in load_extension, which in retrospect is probably the > wrong thing to do (if Markdown is being used as a module)... But it > also didn't feel right to either return None or create an exception > class and raise that. Yes, there is a reason: procrastination. Yes, sys.exit(1) is not appropriate here nor is returning None. (And I should have caught this!) I think the thing to do here is to raise an exception, the only question is what to call it. MarkdownException would be reasonable, though perhaps something more specific would make more sense? Greg's code review (http://www.third-bit.com/pages/reviewing-markdown.html) noted a few other cases where we should do what he calls "if/then/else/oops" instead of "if/then/else". If we fix those, then this would give us more opportunities to use MarkdownException. - yuri |