Skip to content

Conversation

@Bhoomi-bombom
Copy link

Summary

This pull request replaces all assert statements in non-test Python files with explicit exception handling.
The goal is to prevent loss of runtime validation when Python is executed in optimized mode (-O flag), where assert statements are ignored.

Changes Made

Replaced assert statements with appropriate ValueError or RuntimeError exceptions.

Added clear and descriptive error messages for better debugging.

Ensured no modifications were made in test-related files or documentation.

References

Fixes issue: Replace and rewrite "assert" statements in non-test code (#175)

Discussed in: GitHub search and discussion on assert usage

Testing

Verified the changes by running existing unit tests to ensure no regressions.

Confirmed all modified functions raise appropriate exceptions when invalid inputs are provided.

Signed-off-by: bhoomi-bombom <bhoomi.annamdevara2006@gmail.com>
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