David wrote:
spir wrote:
Le Sat, 16 May 2009 21:46:02 -0400,
David <da...@abbottdavid.com> s'exprima ainsi:

I am doing an exercise in Wesley Chun's book. Find files in the standard library modules that have doc strings. Then find the ones that don't, "the shame list". I came up with this to find the ones with;

why not __import__() it then test whether its .__doc__ is None?

def test(filename):
    if __import__(filename).__doc__ is None:
        shame_list.append(filename)
    else:
        fame_list.append(filename)

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to