Message22815
Appending a non-empty element to a non-empty list from
a dictionary results in a list of None
Scope:
Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200
32 bit (Intel)] on win32 and
Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200
32 bit (Intel)] on win32
yield identical results.
Description:
The code (which is supposed to be used in a function
for deleting duplicate files...) contains this line:
print
"Warning!",(md5,len),'*',MainDic[(md5,len)],'*',name,'*',MainDic[(md5,len)].append(name)
which prints the following result:
Warning! ('5e011eda91336d21d3bfc5d5a686bb44\n', '7217')
*
['D:\\_Arbeit\\_In\\_Roaming\\_Telework\\www.ivc.ca\\part9.html',
'D:\\_Arbeit\\_I
n\\_Roaming\\_Telework\\www.ivc.ca\\part9.html.primary']
*
D:\_Arbeit\_In\_Roaming\_Telework\www.ivc.ca\part9.html.primary
* None
How can this be?
The tuple is not empty, the entry for it in the
dictionary exists, it is a list of strings, name is not
empty and a string, but appending name to the list from
the dictionary yields "None". Am I missing something,
or is this really a bug?
|
|
Date |
User |
Action |
Args |
2007-08-23 14:26:57 | admin | link | issue1052036 messages |
2007-08-23 14:26:57 | admin | create | |
|