ID 575957 - Node type does not have the __bool__ function implemented in the Python API

Follow

Problem summary
Node type does not have the __bool__ function implemented in the Python API.
 
Customer reported version
Nuke 14.1v4
 
Customer reported platform
CentOS 7
 
Steps to reproduce
 
1) Open Nuke.
 
2) Run the following code in the Script Editor:

node = nuke.createNode("NoOp")nuke.delete(node)try:    if node:        passexcept ValueError:    node = None    print("deleting node's instance")
 
Expected behaviour
In the example code if node: should return False and catch the ValueError.
 
Actual behaviour
The example code never seems to get into the "except" state and does not catch the ValueError.
 
Workaround
Actually doing something with the node object seems to work as expected. For example:
node = nuke.createNode("NoOp") nuke.delete(node) try:     print(node) except ValueError:     node = None     print("deleting node's instance")
 
Reproduced by support
Guidance: Have you reproduced the problem? In which versions have you reproduced the problem? DELETE THIS LINE
 
This bug has been reproduced in:
Nuke 15.0v4 - Windows 10 - macOS 12 (Monterey)
Nuke 12.0v1 - Windows 10 - macOS 10.13 (High Sierra)
 
Earliest version tested
Nuke 12.0v1
- This issue appears to be in all tested versions of the product
 

    We're sorry to hear that

    Please tell us why