code: def intersect(self, range_):
          self.solver.intersection_broad_tests_count += 1
  
          
          if range_.is_any():
              return self
  
          if self.solver.optimised:
              if range_ in self.been_intersected_with:
                  return self
  
          if self.pr:
              self.pr.passive("intersecting %s wrt range '%s'...", self, range_)
  
          self.solver.intersection_tests_count += 1
  
          with self.solver.timed(self.solver.intersection_time):
              # this is faster than iter_intersecting :(
              entries = [x for x in self.entries if x.version in range_]
  
          if not entries:
              return None
          elif len(entries) < len(self.entries):
              copy_ = self._copy(entries)
              copy_.been_intersected_with.add(range_)
              return copy_
          else:
              self.been_intersected_with.add(range_)
              return self
docs: Remove variants whose version fall outside of the given range.