Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; '16,': 0.03; 'attribute': 0.05; 'none)': 0.07; 'api': 0.09; ':-)': 0.13; 'col': 0.16; 'oct': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'header:In-Reply-To:1': 0.25; 'skip:" 20': 0.26; '(most': 0.27; 'mike': 0.27; 'message- id:@mail.gmail.com': 0.27; 'code': 0.31; 'file': 0.32; 'traceback': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'test': 0.36; 'should': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'total': 0.65; 'to:name:python': 0.84; 'have.': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=O2Hx6pjzLxqXkPzTRsMCAx8eVA93Ox4oQ5tBfZR8Qy4=; b=QLy+z+84MhKrpGqCrMGYo/suGOShxPG6Mxt1U6AU4DWGD7wMkoEtt2fPmFfKM71+sw KKmk9aOtKlvLxUsJQZtD1CrZ68E2y+ObtV39AnPKWiKCAUz4hNwFLC2heprKMNS63sUk qTQbc1v9kVcMI5ZHKdPMUiYOZwzt6RDn+cx7Ukk+JObc4GKXn5kbUi8ud7iNoZgGOZlc cUnMWVh1UseCx45pd+LboBSGL0+PrbAGvFxJ3m60PqX4hKiJ2Zjef2smEQReB5HlWt3G uqASo83GaVVMv8ZxMJVSUw3p4xVLIzqJpxiPSYeudhT62gqj8cHkQIHgCVCFoTF3iAaj jYlA== MIME-Version: 1.0 In-Reply-To: <3e6de8b6-5ad5-4b29-92b4-9e957158ca5a@googlegroups.com> References: <7c7beccb-72e4-4cfb-958d-4a7235076fb3@googlegroups.com> <307d5843-af17-4079-8a48-f8d7351a1d7b@googlegroups.com> <3e6de8b6-5ad5-4b29-92b4-9e957158ca5a@googlegroups.com> From: Ian Kelly Date: Thu, 4 Oct 2012 18:59:03 -0600 Subject: Re: sum function To: Python Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1349398775 news.xs4all.nl 6918 [2001:888:2000:d::a6]:46668 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:30765 On Thu, Oct 4, 2012 at 6:40 PM, Mike wrote: > Traceback (most recent call last): > File "test.py", line 16, in > total = sum(float(col.value) for r in iter(next_r, None) for col in r.itervalues()) > File "test.py", line 16, in > total = sum(float(col.value) for r in iter(next_r, None) for col in r.itervalues()) > AttributeError: 'list' object has no attribute 'itervalues' "r.itervalues()" should have been "r[0].columns.itervalues()", I think. It's hard to test code against an API that you don't have. :-)