Konstantin Veretennicov wrote:
> On 6/22/05, Riccardo Galli <[EMAIL PROTECTED]> wrote:
>
>> I propose to add an 'abs' keyword which would make os.listdir return the
>> absolute path of files instead of a relative path.
>
> What about os.listdir(dir='relative/path', abs=True)? Should listdir
> call abspath on results? Should we add another keyword rel? Would it
> complicate listdir unnecessarily?
>
> - kv
I'm in favour of Riccardo's suggestion, but I think he's got the name of the
keyword wrong. The signature should be
listdir(path, with_path=False)
and cater absolute and relative paths alike.
The need for such an enhancement is not particularly pressing, as
workarounds abound. Here's another one:
>>> glob.glob("/usr/lib/games/../games/*")
['/usr/lib/games/../games/schwarzerpeter']
Peter
--
http://mail.python.org/mailman/listinfo/python-list