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
Also, soup.a.args[0].contents[0] = 'x' works in 0.2.0 but not in the latest version.
Directly setting soup.a.args[0] allows the right hand side to be various types, such as text or TexNode without error, but when calling contents later one would get maximum recursion depth exceeded error in iteration of descendants.
What I would like to achieve, is an extension of the current replace feature. In the case parent not having children, it will go through parent.args to find the node and replace it. However in the case where args[0] has two or more contents, not being able to change in-place would break the DFS iteration outside.
The text was updated successfully, but these errors were encountered:
After some investigation it seems to be a common issue for python getter/setter wrapper, as the grammar .contents[0] = calls the getter of contents instead. Workaround involves accessing the internal .contents_ which is not very elegant.
gives
Also,
soup.a.args[0].contents[0] = 'x'
works in 0.2.0 but not in the latest version.Directly setting
soup.a.args[0]
allows the right hand side to be various types, such as text or TexNode without error, but when callingcontents
later one would get maximum recursion depth exceeded error in iteration of descendants.What I would like to achieve, is an extension of the current
replace
feature. In the caseparent
not having children, it will go throughparent.args
to find the node and replace it. However in the case whereargs[0]
has two or morecontents
, not being able to change in-place would break the DFS iteration outside.The text was updated successfully, but these errors were encountered: