Python extensible grep