Having multiple if x is not None:
conditions can make the code deeply nested and unreadable.
The Maybe
container from the returns
library enhances code clarity through the bind_optional
method, which applies a function to the result of the previous step only when that result is not None.