Not possible to hide local variables

Cecil Westerhof Cecil at decebal.nl
Thu Apr 30 10:50:04 EDT 2015


Op Thursday 30 Apr 2015 14:53 CEST schreef Dennis Lee Bieber:

> On Wed, 29 Apr 2015 22:31:13 -0400, Dave Angel <davea at davea.name>
> declaimed the following:
>
>> On 04/29/2015 10:16 AM, Grant Edwards wrote:
>
>>
>>> raise ParameterError, 'Parameter has to be an int'
>>> if n < 0:
>>
>> Better:   if length < 0:          (since n is undefined)
>>
>>> raise ValueError, 'Parameter should be greater or equal 2'
>
> 	Given the text in the exception, shouldn't that be
>
> 	if length < 2:

Yeah: it already is. No points for punctuality on my side. :-(

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof



More information about the Python-list mailing list