All Questions
2 questions
5
votes
3
answers
669
views
Is it good Python style to write a function that has no effect other than potentially raise exceptions?
Sometimes I find myself writing Python code that looks like this:
def check_stuff(param):
if condition1(param):
return "condition1" # These might be enum values, etc., instead of strings
...
0
votes
0
answers
125
views
Check some value between each function call
Can you recommend a nice way of checking a particular value between calls to a set of functions?
E.g. something like this in Python (might not be terribly 'Pythonic'):
self.error_code = 0 # this ...