[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-ideas
Subject:    Re: [Python-ideas] class os.DirEntry is confusing,
From:       Victor Stinner <victor.stinner () gmail ! com>
Date:       2015-03-21 10:23:26
Message-ID: CAMpsgwbSdb+wCp6xYy3bet1QxAAKQz2WhEnYS1W9QfxkLY1YJw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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, =E7=BD=97=E5=8B=87=E5=88=9A(Yonggang Luo) <luoyon=
ggang@gmail.com> a
=C3=A9crit :

> Should be replaced with os.FsEntry or os.ScanEntry
>
> --
>          =E6=AD=A4=E8=87=B4
> =E7=A4=BC
> =E7=BD=97=E5=8B=87=E5=88=9A
> 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/

[Attachment #5 (text/html)]

Hi,<div><br></div><div>The &quot;DirEntry&quot; name  comes from the POSIX structure \
&quot;direntry&quot;. You should not instanciate the DirEntry class nor store it, so \
not check its type neither (isinstance(something, os.DirEntry)). I don&#39;t think \
that the exact name of the class matters.  I had prefer DirectoryEntry, but \
&quot;dir&quot; shortcut  is common in the Python os module (os.listdir)  and in \
POSIX strandard (opendir, struct direntry).</div><div><br></div><div>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:</div><div><a \
href="https://www.python.org/dev/peps/pep-0471/#naming">https://www.python.org/dev/peps/pep-0471/#naming</a><br></div><div><br></div>I \
accepted the PEP and I don&#39;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.<br><div><br></div><div>Victor</div><div><br>Le  vendredi 20 mars \
2015, 罗勇刚(Yonggang Luo) &lt;<a \
href="mailto:luoyonggang@gmail.com">luoyonggang@gmail.com</a>&gt; a écrit  \
:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Should be replaced with os.FsEntry or os.ScanEntry<br> <br>
--<br>
              此致<br>
礼<br>
罗勇刚<br>
Yours<br>
      sincerely,<br>
Yonggang Luo<br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, \
&#39;Python-ideas@python.org&#39;)">Python-ideas@python.org</a><br> <a \
href="https://mail.python.org/mailman/listinfo/python-ideas" \
target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br> Code of \
Conduct: <a href="http://python.org/psf/codeofconduct/" \
target="_blank">http://python.org/psf/codeofconduct/</a></blockquote></div>



_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic