[Python-ideas] os.listdir default to '.'

Massimo Di Pierro massimo.dipierro at gmail.com
Thu Jan 12 16:28:13 CET 2012


+1

On Jan 12, 2012, at 9:14 AM, Rob Cliffe wrote:

> In Python 2.5 you can at least say os.listdir('') which had the same effect.
> In Python 2.7 you can't.
> 
> Strictly speaking I think the default value should be os.path.curdir, not specifically '.'
> 
> +1 from me
> +1 on allowing the empty string argument again (may avoid breaking some old code)
> 
> Rob Cliffe
> 
> On 12/01/2012 15:02, Michael Foord wrote:
>> 
>> Hello all,
>> 
>> I frequently use Python from the interactive interpreter as a shell. It is a frequent, but mild, irritant that I have to type os.listdir('.') instead of just os.listdir().
>> 
>> How about making '.' a default argument for os.listdir ?
>> 
>> All the best,
>> 
>> Michael
>> 
>> -- 
>> http://www.voidspace.org.uk/
>> 
>> May you do good and not evil
>> May you find forgiveness for yourself and forgive others
>> 
>> May you share freely, never taking more than you give.
>> -- the sqlite blessing http://www.sqlite.org/different.html
>> 
>> 
>> _______________________________________________
>> Python-ideas mailing list
>> Python-ideas at python.org
>> http://mail.python.org/mailman/listinfo/python-ideas
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20120112/08d35db7/attachment.html>


More information about the Python-ideas mailing list