Leif K-Brooks <[EMAIL PROTECTED]> wrote:
>> 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.
Correct
> getattr() is only useful when the attribute name is
> determined at runtime.
>
getattr()
"Jm lists" <[EMAIL PROTECTED]> on Mon, 12 Feb 2007 12:36:10
+0800 didst step forth and proclaim thus:
> 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 g
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 us