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, there are two ways to compare nodes. "exactly equal" including position and every other detail and "looks equal" when their content is similar: ast.Name(id="a") might look equal to other ast.Name(id="a")
Activity
Eclips4 commentedon May 9, 2024
I would like to take this one if you don't mind :)
JelleZijlstra commentedon May 9, 2024
Go for it!
serhiy-storchaka commentedon May 10, 2024
Should it be recursive or not? See also #60191.
For things like
ast.Load()it makes sense to make them singletons. This would automatically solve the problem with equal comparison.sobolevn commentedon May 10, 2024
Also, there are two ways to compare nodes. "exactly equal" including position and every other detail and "looks equal" when their content is similar:
ast.Name(id="a")might look equal to otherast.Name(id="a")Both are useful for static analysis tools.
JelleZijlstra commentedon May 10, 2024
Thanks Serhyi, let's close this as a duplicate of #60191.