We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When passing a float value (e.g. 1.21) to a colander.Integer node, no exception is thrown. I am not sure of the expected behaviour though...
Version: 1.3.3
The text was updated successfully, but these errors were encountered:
Internally the conversion is passed to int(), and Python parses the string and returns an integer: https://github.com/Pylons/colander/blob/master/colander/__init__.py#L1417
int()
Floats will silently truncated.
Adding some extra protection wouldn't be entirely out of line IMHO.
Sorry, something went wrong.
@cecemel Use Integer(strict=True) for this to correctly raise an exception if passed a float instead of a real integers.
Integer(strict=True)
No branches or pull requests
When passing a float value (e.g. 1.21) to a colander.Integer node, no exception is thrown.
I am not sure of the expected behaviour though...
Version: 1.3.3
The text was updated successfully, but these errors were encountered: