Make isinstance(obj, FuncNode) work!!
#57
thorwhalen
started this conversation in
Enhancement
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We needed the is_func_node facade because
isinstance(obj, FuncNode)alone had unexpected behaviors. I think the facade (maybe a better thought out one?) could be useful either way, but I don't like the fact that we don't know whyisinstance(obj, FuncNode)doesn't work the expected way, and shouldn't leave this under the carpet (because other developers will fall into the trap as well!).Here's one of the syndroms of the problem.
Note: You can only reproduce this error if you use the older
is_func_node, which first tries to useisinstance(obj, FuncNode).The code for this is below.
But DAG construction is supposed to take
FuncNodes as is. The code says so, but if we useisinstance(obj, FuncNodeto determine ifobjis aFuncNode, it will fail, in the case of the code above. Putting a break point in theis_func_nodecode, we see thatid(type(obj)) != id(FuncNode). Somehow, it has a differentFuncNodethan the one we constructed the DAG with?The
is_func_nodecodeBeta Was this translation helpful? Give feedback.
All reactions