The question is related to good and bad practice:
From C programming I'm used to check passed arguments at the begin of a function, thereby returning an error-code when something is wrong (e.g. a NULL pointer).
In Python an exception will be raised automatically, when, lets say, a passed Queue object is None or of wrong type and one tries to operate on this invalid queue object. Is it good practice to check datatypes in advance like
def foo(queue):
if issubclass(Queue, arg):
raise ...
# ...
or should the error handling rather be left as a task for the calling function, because something was wrong there? I'm tempted to do it in the first way, but feel, that it might bee wrong.