You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a = $("div")
b = $('[page="2"]')
a.filter(b).css("color", "red")
As you can see, filter accepts another jquery object.
PyQuery however throws the following exception:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
~\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pyquery\pyquery.py in filter(self, selector)
580 if len(args) == 1:
--> 581 selector.__globals__['this'] = this
582 if callback(selector, i, this):
AttributeError: 'PyQuery' object has no attribute '__globals__'
During handling of the above exception, another exception occurred:
AttributeError Traceback (most recent call last)
<ipython-input-7-36cbb5d34989> in <module>
24 print(a.text())
25 print(b.text())
---> 26 print(a.filter(b).text())
~\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pyquery\pyquery.py in filter(self, selector)
583 elements.append(this)
584 finally:
--> 585 f_globals = selector.__globals__
586 if 'this' in f_globals:
587 del f_globals['this']
AttributeError: 'PyQuery' object has no attribute '__globals__'
The text was updated successfully, but these errors were encountered:
Consider the following:
jsfiddle
code:
As you can see, filter accepts another jquery object.
PyQuery however throws the following exception:
The text was updated successfully, but these errors were encountered: