[Tutor] Find files without __doc__ strings
Lie Ryan
lie.1296 at gmail.com
Mon May 18 15:36:48 CEST 2009
David wrote:
> spir wrote:
>> Le Sat, 16 May 2009 21:46:02 -0400,
>> David <david at 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)
More information about the Tutor
mailing list