A bridge player opens with a pre-emptive bid of 3 or 4 of a suit and the opponent doubles. Is this bid assumed to be for take out?
You can't make any assumptions without agreements. In North America, the most common agreement I've seen is that doubles are takeout oriented for bids through at least 4D; I've seen 4D, 4H, 4S, 6D, and 6H as upper bounds on the takeout double range. Standard American Yellow Card specifies that doubles of partscores are for takeout.
Of course there are both advantages and disadvantages of whether a dbl is penalty or take-out.
Because of bridge's nature, the thing you always have to consider when you play a convention (takeout dbl is a conventional bid too), is to make the choice that is going to "win" most of the times.
In my country most of people (myself included) play negative/takeout doubles up to 4h. (ie 4h X is takeout, while 4S X is penalty)
I think that this is a logical upper limit, since when opponents preempt 4h you should be able to play spades with a 4-4 or 4-5 fit. While on the other hand it's more risky to try and find a fit on the 5th level (if 4S was the opening).
For further analysis, if someone wants to use a takeout call after 4S opening, he usually uses the (conventional) bid 4NT.
Unlike a low level bid, where the double is always for takeout, the meaning of a double after a pre-empt is a matter for partnership agreement. There are two alternatives, and which you use is less important than the fact that the partners are on the same page.
One alternative is to double for penalty. A double like that suggests that the doubler has about 16 hcps, two or three trumps with "nuisance" value (possibly Kx or Kxx), and can pretty much defeat the contract by himself. Responder can pass, except with an above-average hand (more than eight of the remaining 24 points).
The second alternative is to double for takeout. That implies 12 hcps and shortness in the opponents' suit, and is similar to a normal takeout double.
The second kind of double is more common (it's easier for someone to have 12 than 16 hcps), and more flexible. It means, "I've got enough to give the opponent's trouble, but can't defeat them alone, and can go different ways depending on what you, the responder, have".
If you have 5 or so hcps and several of the opponent's "trumps," you can pass for penalties (basically with "two kings" less than a one level takeout double). If you have a five card major suit, you and the doubler should either be able to make game, or keep the opponents out of game, using that suit as trump.