Need Help wih List Ops filter

I’m trying to add the list filter using the lambda passed in. I get this error:

RecursionError: maximum recursion depth exceeded
!!! Recursion detected (same locals & position)

This is the code:

def filter(function, list):
    func = function
    nums = list
    odds = list(filter(func, nums))
    return odds

The filter function is calling itself (odds = list(filter(func, nums))) without any guards. It’s an infinite recursion.

Makes sense.

This exercise preloads the function stubs that need to be coded to pass the tests. This function (filter) is called by the tests and I am not able to change that. I suspect the same issue will happen with the stubbed map function. The functions that expect the use of reduce were stubbed with names other than reduce so I am wondering of this exercise needs updating so I can use filter inside the function.

You can access the built-in filter (albeit not trivially) but the whole point of this exercise is to implement these functions yourself. The instructions say, “Implement a series of basic list operations, without using existing functions.”