unsupported operand type(s) for %: 'NoneType' and 'tuple'

Carsten Haese carsten.haese at gmail.com
Mon Dec 7 11:52:47 EST 2009


Victor Subervi wrote:
> Well, if you could point me in the right direction, it would be
> appreciated. I've tried googling this with no luck. Apparently, "expand"
> is not a well-documented term in python and, of course, it's an
> often-used term in English, which further confuses the issue. Yes, I
> would like to understand this code.

If I remember correctly from one of your earlier posts, "expand" is a
name of a function that's actually defined in your code. Understanding
its name won't help you understand what it does. It would do exactly the
same if it were called "frobnicate" and all instances of "expand" in
your code were replaced with "frobnicate".

To understand what the function does, look at the function definition
and pretend that you're the Python interpreter: Follow the code one
instruction at a time and imagine what each instruction does. If you do
this correctly, you will understand what the code does. This won't tell
you *why* it does it, but it's your code, and you put it there to serve
a particular purpose. If you don't understand its purpose, you shouldn't
be using it at all.

--
Carsten Haese
http://informixdb.sourceforge.net




More information about the Python-list mailing list