[Tutor] What does "TypeError: 'int' object is not iterable" mean?

Richard D. Moores rdmoores at gmail.com
Sun Oct 24 13:56:11 CEST 2010


On Sat, Oct 23, 2010 at 02:28, col speed <ajarncolin at gmail.com> wrote:
>
>
>>
>>
>> Message: 7
>> Date: Fri, 22 Oct 2010 21:48:29 -0700
>> From: "Richard D. Moores" <rdmoores at gmail.com>
>> To: "Steven D'Aprano" <steve at pearwood.info>
>> Cc: tutor at python.org
>> Subject: Re: [Tutor] What does "TypeError: 'int' object is not
>>        iterable"       mean?
>> Message-ID:
>>        <AANLkTi=8EszCxYg-rAQBm0YyD=_dKVg4ZKoj+e_QUXX5 at mail.gmail.com>
>> Content-Type: text/plain; charset=UTF-8
>>
>> It's great to have you chime in, Steven. I do wish you would stop
>> pulling your punches, however. ;)
>>
>> <-snip>
>> I've never seen that convention, but I'll try to follow it.
>>
>> >
>> > (BTW, I really hate the name "floatt". It makes me think you're
>> > stuttering.)
>>
>> I'll use "x" instead. Anything you'd like to say about the rest of the
>> script?
>>
>> Thanks, Steven.
>>
>> Dick
>>
>>
>> ------------------------------
>> Excuse me, I'm not a professional. Rather than "x", I would use "float_"
>> or even "not_int", as mentioned in PEP8:
>
> If a function argument's name clashes with a reserved keyword, it is
>       generally better to append a single trailing underscore rather than
> use
>       an abbreviation or spelling corruption.  Thus "print_" is better than
>
> "prnt". (Perhaps better is to avoid such clashes by using a synonym.)
> Steven knows his subject, please don't answer like this.

And I have a request of you: Please don't change the Subject header
when you reply. I didn't see your post with it's important suggestion
until just now.

Thanks for the quote from PEP8.  I went with "myfloat", on Dave
Angel's suggestion, but float_ looks good as well. 'not_int' is not so
good, because many kinds of objects are "not_int"s.

As for Steven, you're absolutely correct -- and I've learned a lot from him.

Dave Angel wrote:
> Sometimes Steven's style can be a bit caustic, but there's almost always a
> few important nuggets.

and I replied:
>Absolutely there are! And I have no problem with his style. I just
>couldn't hold back what I intended to be a gentle jab of sarcasm.
>Dangerous in email--especially an email list.

Dick


More information about the Tutor mailing list