To be fair, they do have nurse's locks as well.
I'd guess the lock belongs to the brake cable bike. If the rack bike's owner comes back first, he's likely to just undo or cut the brake cable and ride off with the other rider's lock.
Alternatively, lock up your bike in a hurry so you don't realise you've also locked someone else's:...
I remember on one club run, locking my bike to a ring bolt in the cafe wall. As I was about to go in, one of the other riders parked his bike against mine, so I told him to lock to my lock, not my bike. "Yes", he said, and I went in. When we came out, I found that he'd locked to my bike, and also hadn't brought his key with him. Words were had, and a pair of side cutters located to chop the cable lock with.