Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def func_return_nothing(a, b):
if a > b:
print(a)
else:
print("Hello World!")
def func_return_something(a, b):
print(a)
return b
def func_several_returns(a, b):
if a > b:
print(a)
return
assert inliner.has_no_return(func_return_nothing)
assert not inliner.has_no_return(func_return_something)
assert not inliner.has_no_return(func_several_returns)
if a > b:
print(a)
else:
print("Hello World!")
def func_return_something(a, b):
print(a)
return b
def func_several_returns(a, b):
if a > b:
print(a)
return
assert inliner.has_no_return(func_return_nothing)
assert not inliner.has_no_return(func_return_something)
assert not inliner.has_no_return(func_several_returns)
print(a)
else:
print("Hello World!")
def func_return_something(a, b):
print(a)
return b
def func_several_returns(a, b):
if a > b:
print(a)
return
assert inliner.has_no_return(func_return_nothing)
assert not inliner.has_no_return(func_return_something)
assert not inliner.has_no_return(func_several_returns)