filter method parameters

Issue #41 resolved
created an issue

now the filter method accept a selector function taking an index parameter, like {{{


pq.filter(lambda i: PyQuery(this).attr('href')=='')


I looked into the code and know the internal gum of what this mean. But it is not friendly to code checkers like Pylint, which will report that the 'this' here is undefined.

why not just accept an selector which takes (index, element) as its parmeter as following? {{{


pq.filter(lambda i, this: PyQuery(this).attr('href')=='')


It's more apparent, easy to read, and more friendly to code checker.

Comments (1)

  1. Log in to comment