Skip to content

fix: validate binary_and inputs - #15277

Open
nishanty23 wants to merge 1 commit into
TheAlgorithms:masterfrom
nishanty23:patch-1
Open

fix: validate binary_and inputs#15277
nishanty23 wants to merge 1 commit into
TheAlgorithms:masterfrom
nishanty23:patch-1

Conversation

@nishanty23

Copy link
Copy Markdown

Description

This PR improves input validation in binary_and().

Changes

  • Raise TypeError when either input is not an integer.
  • Correct the negative-input error message from "positive" to "non-negative".
  • Update doctests to verify the new validation behavior.
  • Add a doctest covering an invalid second argument.

Testing

  • python -m doctest -v bit_manipulation/binary_and_operator.py
  • ruff check bit_manipulation/binary_and_operator.py

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