Only in musical comedies.
Most people whistle so badly that it simply grates on the ear: thin, tuneless, simplistic, and off key. If competition forces one or both whistlers to stop, then great. I once shared an office with a whistler who had no sense of musicality. It was torture. (Yes, I asked him to knock it off. He didn’t seem to know he was doing it and started up again minutes later.)
However, I stayed at a resort once where a grounds worker whistled constantly. He whistled themes from classical music—complete melodies from concertos and symphonies, arias from opera—fully and sweetly, on pitch and with expression. It was beautiful. I was tempted to follow him around just to listen. Whenever he came near, I stopped what I was doing. Whistle like that and I’ll be your biggest fan.
In general, forcing anybody to listen to your intrusive noise is rude, whether it be your loud conversation, your screaming baby, your idling motorcycle, or your music-delivery device. Whistling doesn’t get a pass.