That's similar to how my children would be punished for misbehaviour today (grounding - ie no playing out and no friends in) is usually what I go for, but they are old enough at 10 and 13 for that to have an impact. They are old enough to reason with and to explain things to.
What I'd really like to know is how you go about preventing a toddler from doing something which may be dangerous. (fingers in the fire and that kind of thng) I don't assume a toddler is even aware of the existence of a computer so to deprive them of it wouldn't mean anything. I don't personally know of an alternative which would be effective and would appreciate knowing how you disciplined yours when they were tiny.
I know someone suggested earlier in this thread that I abuse my children by continually hitting them which is a million miles from the truth. They were smacked when they were too young to understand anything different (or I was unaware of anything which they would understand at that age) and having learned not to do those things we moved on. As they grew older then it became more possible to reason with them and to explain the reasons for not doing things.
Yes, I did try to protect them from dangers but I had one toddler who managed to build herself a bridge to climb over the child gate at her bedroom door - that was the kind of initiative I was up against. I put plug guards in the sockets, she removed them. I said "don't do that" She still removed them.
Perhaps you've been very lucky with children who understood your instructions from a very early age and didn't experiment with ways to overcome obstacles.