Re: Possible bug with Number validator

Ian Bicking <[email protected]> Tue, 7 Apr 2009 20:55:06 -0500
Newsgroups gmane.comp.python.formencode
Message-ID <[email protected]>
Yes, probably it would be reasonable behavior for 'inf' to be invalid,
except if some settings was on the Number validator to allow it (like
Number(allow_infinity=True)).  But at the moment infinity is allowed and
actually tested for.  I guess at some point I was convinced it would be a
good idea to just accept it.

On Tue, Apr 7, 2009 at 7:56 PM, Aston Motes <[email protected]> wrote:

> I generally expect the Number validator to either return a number
> (float or int) or raise an Invalid exception. However, if I do the
> following:
>
> from formencode.validators import Number
> Number.to_python('inf')
>
> I get an OverflowError related to 'inf' being interpreted as the float
> infinity. The same thing happens with 'infinity' as the input string.
>
> Is this a for reals bug with FormEncode, or just a corner case
> exception I should be aware of and catch?
>
> Thanks,
>   - Aston
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
> _______________________________________________
> FormEncode-discuss mailing list
> FormEncode-discuss-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/formencode-discuss
>



-- 
Ian Bicking  |  http://blog.ianbicking.org

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com

_______________________________________________
FormEncode-discuss mailing list
FormEncode-discuss-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/formencode-discuss