Pychecker Re: Nested List Question

Chris McCoy chris.mccoy at spirentcom.com
Thu Nov 3 01:55:33 EST 2005


It may, but I haven't been using Pychecker yet.  I'm still fairly new to 
Python.

Thanks,
Chris M.

"Roman Suzi" <rnd at onego.ru> wrote in message 
news:mailman.55.1130998328.18701.python-list at python.org...
> On Thu, 3 Nov 2005, Chris McCoy wrote:
>
>> Thank you!  I've been banging my head against the wall!
>>
>> Chris M.
>
>>> gridSystemId = [[None]*columns]*rows
>>
>> You've made gridSystemID a list of `rows` references to the SAME "inner"
>> list, so the behavior you observe is the only possible one.
>>
>> If you want copies instead, ASK for copies...:
>>
>> gridSystemId = [ [None]*columns for x in xrange(rows) ]
>
>
> Interesting, could not pychecker recognize such situations in Python
> code and give warnings?
>
>
> Sincerely yours, Roman Suzi
> -- 
> rnd at onego.ru =\= My AI powered by GNU/Linux RedHat 7.3
> 



----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----



More information about the Python-list mailing list