Missing return statement
491 if not unit.isobsolete() and not unit.isheader()
492 )
493
494 def delete_unit(self, ttkit_unit) -> str | None: 495 self.store.removeunit(ttkit_unit)
496
497
Description
This callable is expected to return a value but is missing a return
statement.
Double check that you didn't forget to return the correct value, or if the function doesn't actually return anything, fix the type annotation to -> None
instead.
Bad practice
def greet(name: str) -> str:
f'Hello, {name}!' # Forgot to print or return
Recommended
def greet(name: str) -> str:
return f'Hello, {name}!'
# Alternatively,
def greet(name: str) -> None: # as this doesn't return anything
print(f'Hello, {name}!')