222 return json.loads(r.text)
223
224 @staticmethod
225 def handle_captcha_solved_result(solved: dict) -> str: # type: ignore226 """Since CAPTCHA sometimes appears as a very simple binary arithmetic expression.
227 But since recognition sometimes doesn't show the result of the calculation directly,
228 that's what this function is for.
According to PEP8, if any return statement returns an expression, any return statements where no value is returned should explicitly state this as return None
, and an explicit return statement should be present at the end of the function (if reachable).
Good:
def foo(x):
if x >= 0:
return math.sqrt(x)
else:
return None
def bar(x):
if x < 0:
return None
return math.sqrt(x)
Bad:
def foo(x):
if x >= 0:
return math.sqrt(x)
def bar(x):
if x < 0:
return
return math.sqrt(x)