I have one function (F1) returning the values of (a, b, c) and other function (F2) using those values. I need to check on F2 if "a is None".
This is the first function (F1)
def get_info():
msg = get_msg()
number = get_number()
if msg is not None:
return msg, number
return False, False
Secound function (F2)
def save_log():
msg, number = get_info()
if msg:
do_more_stuff
If I don't do return False, False
in the first function I get TypeError: 'bool' object is not iterable
in the second function.
Do I have a better way of returning those values other than return False, False
.
What is the pythonic best practice in this situation? Thanks