Skip to content

NULL_OBJ now is false in truthy check#696

Merged
Amourspirit merged 2 commits into
developfrom
0.52.5
Mar 12, 2025
Merged

NULL_OBJ now is false in truthy check#696
Amourspirit merged 2 commits into
developfrom
0.52.5

Conversation

@Amourspirit
Copy link
Copy Markdown
Owner

This pull request includes updates to the NULL_OBJ implementation in ooodev/utils/gen_util.py, version bump in pyproject.toml, and the addition of new tests.

Updates to NULL_OBJ:

  • ooodev/utils/gen_util.py: Replaced the NULL_OBJ constant with a class _null_obj that overrides the __bool__ method to return False. This ensures NULL_OBJ evaluates to False in boolean contexts.

Version bump:

New tests:

  • tests/test_utils/test_null_obj.py: Added tests to verify the behavior of NULL_OBJ, ensuring it evaluates to False in boolean contexts, is not None, and that multiple references point to the same instance.

@Amourspirit Amourspirit merged commit e397ce2 into develop Mar 12, 2025
@Amourspirit Amourspirit deleted the 0.52.5 branch March 12, 2025 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant