16 staff_login(self.options)
17 return super().setUp()
18
19 def get_recent_post_link(self, msg_text: str): 20 trs = self.driver.find_elements(by=By.CSS_SELECTOR, value="#content table tr")
21 for tr in trs:
22 tds = tr.find_elements(by=By.TAG_NAME, value="td")
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)