On 9/20/19 4:36 PM, Stephen Satchell wrote:
> On 9/20/19 2:47 PM, Tim Stumbaugh wrote:
>> You get the same pylint warning, but better yet, you get a `NameError`
>> raised at the point of the `del`. Your suggestion of moving the loop to the
>> function would alleviate the problem, since there would be no need for the
>> explicit `del`. If that's unavoidable, you could add an explicit `device =
> 
> Indeed.  I duplicated your code and found that it works exactly how you
> described.  The situation where the original list would be empty isn't
> supposed to happen...famous last words.

that's what try/except is for :)


> 
> I moved the loop into its own function.  Problem solved.
> 
> Thank you for your comments and insight.  I learned something today.
> _______________________________________________
> code-quality mailing list -- code-quality@python.org
> To unsubscribe send an email to code-quality-le...@python.org
> https://mail.python.org/mailman3/lists/code-quality.python.org/
> 
_______________________________________________
code-quality mailing list -- code-quality@python.org
To unsubscribe send an email to code-quality-le...@python.org
https://mail.python.org/mailman3/lists/code-quality.python.org/

Reply via email to