Method to act on parameter or from iterable if not parameters are passed
Not going into the question as to whether or not this is a good idea, I can see very little wrong with the solution.

One thing I would very much like to suggest is the following.

Instead of

map(func, search(query))


please write

for result in search(query):
    func(result)


There are actually some differences:


In Python 3, map builds a iterable, and func(result) will only be called if the iterable is looped over. In this case, this is most definitely not what you want!
In Python 2, map builds a list, and thus evaluates everything. Better, but an intermediate list is now going to be build and thrown away.


In general I would recommend only using map for functions that are side-effect free.

Another thing I'd like to remark is where you build the namedtuple. You do it inside the function, building a new Task class for every task you add. Please move that code outside of the function task.