Why is the work done by a gas during free expansion zero and not infinity? Suppose there's a spaceship that has a hole in it. Gas is expanding through the hole from the spaceship to outer space (vacuum). According to pressure volume work ($P\Delta V$) the work done by the gas is infinity. According to my homework assignment, it's $0$. Can someone please explain why?

Edit:

According to Wikipedia:


  $P$ denotes the pressure inside the system and outside the system, against which the system expands; the two pressures are practically equal for
  a reversible process;


How can $P$ denote two different quantities? Can't this rule be applied for situations where the pressures inside and outside the system are different?
The external pressure in space is 0 (well, depends where and not quite, but for the discussion let's say that it is). So $P \cdot \Delta V$ is also 0. Gas expanding from a hole in a spaceship is not an irreversible process. Such processes are very slow and gradual, such that the external pressure has time to equilibrate with the internal pressure.

On the contrary - you have the most irreversible process in here. Gas leaking from a hole in a spaceship into a medium (space) that will never equilibrate with the internal pressure.

Think about it from an intuitive point of view. Work done by an expanding system is there because it moves other things around. In space there is nothing to move, so no work done.