There's a pretty wide latitude for things that could be considered "unusual" punishments. That would be limited only by the creativity of the sentencing judge short of cruelty. It might not be such a good idea to give judges such discretion in sentencing, would you want to be ordered to marry your SO if you had been about to break up with her (or even felt ambivalent about the idea) for example?
|