Astronauts on a spacewalk cannot whistle. This was discovered on the fly by intrepid astronaut Dan Barry in 1999. Fortunately, it did not affect the mission, but should any astronaut have to call a dog in space, the results would be disastrous.
Space agencies try to work out all eventualities and possible needs, but one unexpected consequence of space travel was discovered during a space walk by astronaut Dan Barry. A usual function, performed perfectly normally on earth, suddenly failed in deep space. Fortunately, it wasn't necessary for the mission. Barry just tried whistling. Tried, and failed.
Several other astronauts have tried whistling during space walks, with the selections of tunes including the obvious "Whistle While You Work" and the Leave it to Beaver theme. No one could manage to get the notes out. It simply wasn't possible.
Whistling works by passing a stream of air through (or over) a narrow passage leading to an enclosed space. The air inside the space vibrates fast, producing a sound. The whole technique requires air, and lots of it. Space suits keep astronauts from suffering from the effects of the vacuum around them, but they don't have the same oomph of an entire atmosphere's worth of pressure. Earthbound humans have 14.7 pounds per square inch of air pressing on them every second of the day. Space suits only put about 4.3 pounds of pressure per square inch on the wearer. The amount of air being force by the lips isn't enough to create those huge, rapid vibrations.
Humming remains unaffected.