Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add New Number Validators #14

Closed
chinmay29hub opened this issue Dec 31, 2024 · 3 comments · Fixed by #16
Closed

Add New Number Validators #14

chinmay29hub opened this issue Dec 31, 2024 · 3 comments · Fixed by #16
Assignees
Labels
enhancement New feature or request

Comments

@chinmay29hub
Copy link
Member

Is your feature request related to a problem? Please describe.
I'm always frustrated when I need to perform common number validations such as checking if a number is prime, even, odd, a multiple of another number, a perfect square, or a perfect cube. These validations are not directly available as built-in Python functions.

Describe the solution you'd like
I would like to add the following new validators to the NumberValidator class:

  • isPrime: Check if a number is a prime number.
  • isEven: Check if a number is even.
  • isOdd: Check if a number is odd.
  • isMultipleOf: Check if a number is a multiple of another number.
  • isSquare: Check if a number is a perfect square.
  • isCube: Check if a number is a perfect cube.

These methods will provide useful validation functionality that is not directly available as default Python features.

Describe alternatives you've considered
I have considered using external libraries or writing these validations as standalone functions. However, integrating them into the NumberValidator class will provide a more cohesive and consistent approach within the library.

  • I am interested in working on this feature and would like to contribute to the project. Please assign this issue to me : ).
@chinmay29hub chinmay29hub added the enhancement New feature or request label Dec 31, 2024
@codeperfectplus
Copy link
Member

Hi @chinmay29hub ,

Thank you for submitting this feature request and proposing to contribute! I agree that adding these validations to the NumberValidator class would enhance the library's utility and make common numerical checks more accessible.

@chinmay29hub
Copy link
Member Author

Which formatter should be used for development?

My default is - Black Formatter

@chinmay29hub chinmay29hub mentioned this issue Jan 1, 2025
2 tasks
@codeperfectplus
Copy link
Member

I am using flake8.

@codeperfectplus codeperfectplus linked a pull request Jan 1, 2025 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants