Ned Deily added the comment:

I think you are misunderstanding how del and mutable sequences work.  In your 
code snippet, the del unbinds the name "root_dir" but it does not alter the 
dirnames list object returned by os.path.  Try replacing "del root_dir" with 
"del root_dir[:]" or "root_dir.clear()".

http://docs.python.org/3/reference/simple_stmts.html#the-del-statement
http://docs.python.org/3/library/stdtypes.html#mutable-sequence-types

----------
nosy: +ned.deily
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20764>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to