[Numpy-discussion] local variable referenced before assignment

Edoardo Pasca edo.paskino at gmail.com
Tue May 31 05:48:47 EDT 2011


On Tue, May 31, 2011 at 11:34 AM, Vincent Schut <schut at sarvision.nl> wrote:
> On 05/31/2011 11:04 AM, Edoardo Pasca wrote:

>> UnboundLocalError: local variable 'maxFastSampling' referenced before assignment
>>
>> I wonder whether you see any way that the maxFastSampling variable
>> might not be set.
>
> Edo,
>
> When len(tt) is <2, range(1, len(tt)) gives an emtpy list, the for loop
> will never execute and maxFastSampling will not be set.
>
> VS.

Dear Vincent,

thank you for the prompt response. That's indeed the cause. Now I am
investigating what happens in the procedure that calls the function
passing tt.

Thanks

Edo

>>
>> Python 2.6.4
>> numpy 1.5.0
>>
>> Thanks
>>
>> Edo
>>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>



-- 
Edo
weblog  http://edo.imanetti.net/wordpress
podcast http://sieegiueeaccaso.blogspot.com
cooking http://edo.imanetti.net/cucina
:wq



More information about the NumPy-Discussion mailing list