About getattr()

Jm lists practicalperl at gmail.com
Sun Feb 11 23:36:10 EST 2007


Hello,

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

Thanks!



More information about the Python-list mailing list