Jm lists wrote: > Since I can write the statement like: > >>>> print os.path.isdir.__doc__ > Test whether a path is a directory > > Why do I still need the getattr() func as below? > >>>> print getattr(os.path,"isdir").__doc__ > Test whether a path is a directory
You don't. getattr() is only useful when the attribute name is determined at runtime. -- http://mail.python.org/mailman/listinfo/python-list