I'd be inclined to do it this way:
```scala
/**
 * A [[org.apache.spark.Partitioner]] that partitions sortable record pairs by range into roughly
 * equal sub-ranges. This class is intended for use with PairRDDs, and is a specialization of
 * [[org.apache.spark.OrderingRangePartitioner]]. The sub-ranges are determined by sampling the
 * keys of the PairRDD passed in.
 */
class RangePartitioner[K: Ordering: ClassTag, V](
    partitions: Int,
    @transient rdd: RDD[_ <: Product2[K,V]],
    private val ascending: Boolean = true)
  extends OrderingRangePartitioner[K](partitions, rdd.map(_._1), ascending)

/**
 * A [[org.apache.spark.Partitioner]] that partitions sortable records by range into roughly
 * equal sub-ranges. The sub-ranges are determined by sampling the content of the RDD passed in.
 */
class OrderingRangePartitioner[T: Ordering: ClassTag](
    partitions: Int,
    @transient rdd: RDD[T],
    private val ascending: Boolean = true)
  extends Partitioner {
```