Closes #787
This PR adds support for defining a range of accepted values for commands.LargeInt.
If both bounds are specified, we restrict the length of the string input according to the number of digits (and sign) of the bounds.
We also raise an error during conversion, if the provided value would exceed the defined range (for example Range[LargeInt, 100, 200] would have actual possible input of 100-999).
I've also implemented a check in case the developer attempts to define a range exceeding ±2**53 with the normal int type, directing them to LargeInt.
Checklist
[x] If code changes were made, then they have been tested
[ ] I have updated the documentation to reflect the changes
[x] I have formatted the code properly by running pdm lint
[x] I have type-checked the code by running pdm pyright
[ ] This PR fixes an issue
[x] This PR adds something new (e.g. new method or parameters)
[ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)
[ ] This PR is not a code change (e.g. documentation, README, ...)
Summary
Closes #787 This PR adds support for defining a range of accepted values for
commands.LargeInt
.If both bounds are specified, we restrict the length of the string input according to the number of digits (and sign) of the bounds.
We also raise an error during conversion, if the provided value would exceed the defined range (for example
Range[LargeInt, 100, 200]
would have actual possible input of 100-999).I've also implemented a check in case the developer attempts to define a range exceeding ±2**53 with the normal
int
type, directing them toLargeInt
.Checklist
pdm lint
pdm pyright