Doesn't the end condition here `and operation in ('', None)` prevent the following code from running if an operation has been provided?