Article 50K7W Python3 IOError Exception hierarchy

Python3 IOError Exception hierarchy

by
shogun1234
from LinuxQuestions.org on (#50K7W)
Not very familiar with Python3. Recently I am refactoring some code, finding following class relationship where UserApiError actually inherit from IOError. However in some other python files (.py) it would raise UserApiError(HttpError("remote http service goes wrong!")). I am confused because checking some online docs ( e.g. https://www.tutorialspoint.com/objec..._classes.htm); though Exception are the parent of IOError, HttpError should have no direct relation with IOError. Why it's valid to pass in HttpError to UserApiError class?

Code:class Error(Exception):
pass

class HttpError(Error):
pass

class UserApiError(IOError):
"""Wrapper that wraps actual error, exception and throws back to caller"""
passlatest?d=yIl2AUoC8zA latest?i=1T7BBS0T0A0:a-XBqgWzAw8:F7zBnMy latest?i=1T7BBS0T0A0:a-XBqgWzAw8:V_sGLiP latest?d=qj6IDK7rITs latest?i=1T7BBS0T0A0:a-XBqgWzAw8:gIN9vFw1T7BBS0T0A0
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments