suppose that I have the two functions below:
def copy(src, dst) -> bool
"copy src to dst return True if succeed else False"
def delete(src) -> bool
"delete src return True if succeed else False"
src and dst can be complicated Objects, not just generic. the code is implemented correctly.
using those two functions I would like to implement move() function and return true if only both succeeded:
def move(src, dst) -> bool
return copy(src, dst) and delete(src)
the order of the terms in the and statement is important since I cannot delete src object before copying it.
is there any way of defining in the and (or any other logical operator) to do first the copying and then the deletion? does the order matters?
p.s: I know that I can do it like this:
def move(src, dst) -> bool
b1 = copy(src, dst)
b2 = delete(src)
return b1 and b2
but, I would like to do it as a one-liner as shown.