Extension module mystery

Fredrik Lundh fredrik at pythonware.com
Mon Jul 26 15:09:21 EDT 1999


Markus Demleitner <msdemlei at tucana.harvard.edu> wrote:
> Now, when I try the following:
> lis = ldw.ldw("Hol",["Kohl","Pfohl"]) 
> a = max(lis)
> (ldw.ldw being the glue function), I get
> Traceback (innermost last):
>   File "zw.py", line 3, in ?
>     a = max(lis)
> TypeError: argument 2: expected string, list found
> (that's python 1.5.2, FWIW).  Odd, isn't it?  Why
> should max insist on a string?

maybe it isn't max that generates that error;
instead, it looks like you've missed to test for
a Python exception somewhere (if you ignore
errors, and don't call PyErr_Clear() to clean up,
Python may raise them later...)

could it be that you forgot to change the glue
function to look for an object rather than a
string?

</F>





More information about the Python-list mailing list