os.path.islink documentation error?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Dec 3 19:31:54 EST 2007


En Tue, 27 Nov 2007 14:46:24 -0300, Diez B. Roggisch <deets at nospam.web.de>  
escribió:

> Giampaolo Rodola' schrieb:
>> os.path.islink documentation says:
>>
>> "Return True if path refers to a directory entry that is a symbolic
>> link. Always False if symbolic links are not supported."
>>
>> It's not clear to me why it is mentioned the DIRECTORY term.
>> Shouldn't os.path.islink be used to just check if the *path* passed as
>> argument is a symlink?
>> In such case I would change it in:
>>
>> "Return True if path refers to a symbolic link"
>
>
> But it does say so. It talks about entries in a directory being symbolic
> links. Not the entries being symbolic links to directories.

But it's a bit confusing. Most of the directory functions in module os  
operate on "directory entries" anyway, but it's not explicitely written as  
in this case. To be consistent, os.remove should be "remove the directory  
entry `path`", os.rename should be "rename the directory entry for `src`  
to `dst`", etc.

-- 
Gabriel Genellina




More information about the Python-list mailing list