Message167645
| Author |
axw |
| Recipients |
axw, ezio.melotti |
| Date |
2012年08月07日.22:10:44 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1344377446.47.0.0219808809776.issue15579@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
This simple snippet demonstrates the misbehaviour. Confirmed on two amd64 machines, python 2.7.3.
###################
import copy
uzlist = [u'abc', u'def', u'ghj', u'klm', u'zxc']
utzdict = {u'abc':1, u'def':2, u'ghj':3, u'klm':4, u'zxc':5}
utemplist = copy.copy(uzlist)
for m in utemplist:
if m in utzdict.keys(): utemplist.remove(m)
# utemplist should be empty now - it is not!
>>> utemplist
[u'def', u'klm']
utemplist = copy.copy(uzlist)
for i in range(len(uzlist)):
try:
if utzdict[ uzlist[i] ]: utemplist.remove( uzlist[i] )
except KeyError: pass
# utemplist should be empty now. This time it is:
>>> utemplist
[] |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年08月07日 22:10:46 | axw | set | recipients:
+ axw, ezio.melotti |
| 2012年08月07日 22:10:46 | axw | set | messageid: <1344377446.47.0.0219808809776.issue15579@psf.upfronthosting.co.za> |
| 2012年08月07日 22:10:45 | axw | link | issue15579 messages |
| 2012年08月07日 22:10:44 | axw | create |
|