Can't tell you how many times I've done this.
A few years ago I started using these float valves, that are normally used to fill horse and cattle troughs, they are not fool proof, but when the tank (in my case sumps) get full, the pipes would start to shudder after being restricted by the float, and creat water hammer, giving me enough of a audible warning to shut the tap off. They can be attached to a Python, and the back pressure will usually force it open enough when full, to send make up water into the sink, instead of overflowing the tank.
I got them at farm feed outlets for about $12 each.
These things saved my arsenal a number of times.