On 26/08/15 17:29, Alan Gauld wrote:
def make_validator(min, max, *values):
def validate(value):
return (min <= value <= max) or value in *values)
return validator
Oops!
Should of course be
return validate
Sorry,
--
Alan G
Author of the Learn to Program web site
ht
> Subject: Re: value range checker
> To: sjeik_ap...@hotmail.com
> CC: tutor@python.org
> From: matt.ruff...@gmail.com
> Date: Thu, 27 Aug 2015 12:41:45 -0400
>
> On 2015-08-26 09:19, Albert-Jan Roskam wrote:
>> For example, the category-min-max tuples
>>
> To: tutor@python.org
> From: alan.ga...@btinternet.com
> Date: Wed, 26 Aug 2015 17:29:08 +0100
> Subject: Re: [Tutor] value range checker
>
> On 26/08/15 14:19, Albert-Jan Roskam wrote:
>
>> I have a written a function ch
Albert-Jan Roskam wrote:
> I have a written a function checks the validity of values. The ranges of
> valid values are stored in a database table.
>
> Such a table contains three columns: category, min and max. One record of
> such a table specifies the range for
>
> a certain category, but a ca
On 26/08/15 14:19, Albert-Jan Roskam wrote:
I have a written a function checks the validity of values.
> The ranges of valid values are stored in a database table.
That's an unusual choice because:
1) using a database normally only makes sense in the case
where you are already using the datab
Hello,
I have a written a function checks the validity of values. The ranges of valid
values are stored in a database table.
Such a table contains three columns: category, min and max. One record of such
a table specifies the range for
a certain category, but a category may be spread out over