I often have code similar to
a = somefunction()
if a:
do_something()
Is there in Python a construction which would blend the initialization with the condition test? Something like
if a = somefunction():
do_something()
which would test a
after it has been assigned a value via somefunction()
?