From 4177b75e7a5a3c730748751c6bf26d6103d5ce04 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 4 Mar 2025 16:00:54 +1100 Subject: [PATCH] Cleanup: quiet warnings from ruff, use static sets --- scripts/startup/bl_operators/node.py | 6 +++--- scripts/startup/bl_ui/space_node.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/startup/bl_operators/node.py b/scripts/startup/bl_operators/node.py index 508cf60b73e..6d4c8488c36 100644 --- a/scripts/startup/bl_operators/node.py +++ b/scripts/startup/bl_operators/node.py @@ -314,7 +314,7 @@ class NODE_OT_interface_item_new(NodeInterfaceOperator, Operator): active_item = interface.active # Panels have the extra option to add a toggle. - if active_item and active_item.item_type == 'PANEL' and tree.type in ('GEOMETRY', 'SHADER'): + if active_item and active_item.item_type == 'PANEL' and tree.type in {'GEOMETRY', 'SHADER'}: items.append(('PANEL_TOGGLE', "Panel Toggle", "")) return items @@ -476,7 +476,7 @@ class NODE_OT_interface_item_make_panel_toggle(NodeInterfaceOperator, Operator): if not parent_panel: return {'CANCELLED'} - if not type(active_item) is bpy.types.NodeTreeInterfaceSocketBool: + if type(active_item) is not bpy.types.NodeTreeInterfaceSocketBool: return {'CANCELLED'} active_item.is_panel_toggle = True @@ -527,7 +527,7 @@ class NODE_OT_interface_item_unlink_panel_toggle(NodeInterfaceOperator, Operator return {'CANCELLED'} first_item = active_item.interface_items[0] - if not type(first_item) is bpy.types.NodeTreeInterfaceSocketBool or not first_item.is_panel_toggle: + if type(first_item) is not bpy.types.NodeTreeInterfaceSocketBool or not first_item.is_panel_toggle: return {'CANCELLED'} first_item.is_panel_toggle = False diff --git a/scripts/startup/bl_ui/space_node.py b/scripts/startup/bl_ui/space_node.py index f9a11936875..b1ad50f3308 100644 --- a/scripts/startup/bl_ui/space_node.py +++ b/scripts/startup/bl_ui/space_node.py @@ -911,7 +911,7 @@ class NODE_MT_node_tree_interface_context_menu(Menu): active_item = tree.interface.active layout.operator("node.interface_item_duplicate", icon='DUPLICATE') - if tree.type in ('GEOMETRY', 'SHADER'): + if tree.type in {'GEOMETRY', 'SHADER'}: layout.separator() if active_item.item_type == 'SOCKET': layout.operator("node.interface_item_make_panel_toggle")