Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def wipe_component_info(self) -> None:
},
}

def is_empty(val: Any) -> bool:
def is_empty(val: Any) -> bool: # noqa: ANN401
return val in (None, "", 0, 0.0, {}) or (isinstance(val, dict) and not val)
Copy link
Preview

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider replacing the complex logic with return not val as suggested in the PR description. The current implementation val in (None, "", 0, 0.0, {}) or (isinstance(val, dict) and not val) is redundant since Python's truthiness evaluation already handles these cases correctly, and the dict check is unnecessary as empty dicts are falsy.

Suggested change
return val in (None, "", 0, 0.0, {}) or (isinstance(val, dict) and not val)
return not val

Copilot uses AI. Check for mistakes.


def merge_defaults(target: dict, defaults: dict) -> None:
Expand Down
Loading