class os.DirEntry is confusing,
Should be replaced with os.FsEntry or os.ScanEntry -- 此致 礼 罗勇刚 Yours sincerely, Yonggang Luo
Hi, The "DirEntry" name comes from the POSIX structure "direntry". You should not instanciate the DirEntry class nor store it, so not check its type neither (isinstance(something, os.DirEntry)). I don't think that the exact name of the class matters. I had prefer DirectoryEntry, but "dir" shortcut is common in the Python os module (os.listdir) and in POSIX strandard (opendir, struct direntry). You are coming late. The PEP was discussed during 3 months (may-july 2014), and Ben started to work on it since 2012! See the PEP for details: https://www.python.org/dev/peps/pep-0471/#naming I accepted the PEP and I don't plan to modify it even if you have a serious rationale for the change. Bikeshedding is not :-) By the way, the PEP is implemnted. os.scandir() is already in the latest python 3.5 alpha. Optimized os.walk() will be in the next alpha. Victor Le vendredi 20 mars 2015, 罗勇刚(Yonggang Luo) <luoyonggang@gmail.com> a écrit :
Should be replaced with os.FsEntry or os.ScanEntry
-- 此致 礼 罗勇刚 Yours sincerely, Yonggang Luo _______________________________________________ Python-ideas mailing list Python-ideas@python.org <javascript:;> https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
participants (2)
-
Victor Stinner
-
罗勇刚(Yonggang Luo)