Message228100
I have to disagree. The intent is clearly expressed in the docs [1]. However, if I have a need to deal with partial amounts (say, 2.5 apples because I gave half of one to my horse ;), Counter will still work with that:
--> treats = Counter({'carrots':12, 'apples':3, 'sugar_cubes':100})
--> treats
Counter({'sugar_cubes': 100, 'carrots': 12, 'apples': 3})
--> treats['apples'] -= 0.5
--> treats
Counter({'sugar_cubes': 100, 'carrots': 12, 'apples': 2.5})
At least, it will until we fix that bug. ;) |
|
Date |
User |
Action |
Args |
2014-10-01 17:35:50 | ethan.furman | set | recipients:
+ ethan.furman, rhettinger, pitrou, scoder, eric.smith, steven.daprano, r.david.murray, cool-RR, serhiy.storchaka, josh.r |
2014-10-01 17:35:49 | ethan.furman | set | messageid: <1412184949.95.0.58962778712.issue22515@psf.upfronthosting.co.za> |
2014-10-01 17:35:49 | ethan.furman | link | issue22515 messages |
2014-10-01 17:35:49 | ethan.furman | create | |
|