problem with str()

Matimus mccredie at gmail.com
Thu Mar 15 16:22:32 EDT 2007


Don't use built-ins as variable names. Your code will work if you
change this:

> methodList = [str for str in names if callable(getattr(obj, str))]

to this:
> methodList = [s for s in names if callable(getattr(obj, s))]




More information about the Python-list mailing list