Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 2
    You should catch the exception when you can handle the error. It's hard to say with your example. The question is, what would your handler do if you wrote one, versus writing it at a different place in the call chain? Commented Dec 30, 2013 at 18:50
  • 2
    I think that what is meant by "passing an error silently" is to catch it, and not do anything useful with it (i.e. swallow it). If you don't catch it, it continues to the next level, and you can count on it not being "silent" -- someone will shout out. Commented Dec 30, 2013 at 18:54
  • For example the routine of my program fails somewhere. Should I print a little error message, that something at this specific point went wrong. For debbuging is this helpful, but the finaöl user is more or less interested, that function xyz got a wrong parameter. Commented Dec 30, 2013 at 18:55
  • 3
    Not really related to error handling, but in this example, the pythonic thing to do with a tuple is to just handle it like you'd handle a list or generator input. Duck typing lets you do that. Commented Dec 30, 2013 at 18:56
  • @shx2 Exactly that was my intention of this question. Commented Dec 30, 2013 at 18:59