<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def limit(self, n):
 """ Enforces the Stream to finish after ``n`` items. """

    data = self._data
    self._data = (next(data) for _ in xrange(int(round(n))))
    return self