Quicksort implementation using filter() to perform partitioning from operator import ge as greater, lt as lesser

def qsort(L): 
    if len(L) &lt;= 1: return L
    pivot   = L[0]
    sublist = lambda op: [*filter(lambda num: op(num, pivot), L[1:])]

    return qsort(sublist(lesser))+ [pivot] + qsort(sublist(greater))


It seems like an overkill to have two lambdas in the sublist definition. How can I refactor the sublist lambda function to not include lambda at all?
I think having one lambda in your definition of sublist is perfectly appropriate, but the use of filter isn't appropriate because you are going to need a list anyway. You aren't using it wrong, there are just better solutions.

Also, as noted in the other answer, you can avoid repeated slicing L by creating a copy of the list on the first run of the function through an optional default argument (see first in the code below).

Finally, summing three lists in your return statement is probably less than optimal. With unpacking in Python 3, you can turn this into a single comprehension which should be better in terms of intermediate object creation.

from operator import ge, lt

def qsort(L, first=True):
    if len(L) &lt;= 1: 
        return L

    L = L[:] if first else L  
    pivot = L.pop()
    sublist = lambda op: [n for n in L if op(n, pivot)]

    return [*qsort(sublist(lt), False), pivot, *qsort(sublist(ge), False)]