On Tue, Aug 16, 2016 at 4:14 PM, Victor Stinner <victor.stin...@gmail.com>
wrote:

> By the way, for all these reasons, I'm not really excited by Python
> 3.6 change exposing os.DirEntry ( https://bugs.python.org/issue27038
> ).
>

But that's separate from the constructor. We could expose the class with a
constructor that always fails (the C code could construct instances through
a backdoor). Exposing the type is useful for type annotations, e.g.

def is_foobar(de: os.DirEntry) -> bool: ...

and for the occasional isinstance() check.

Also, what does the scandir package mentioned by the OP use as the
constructor signature?

-- 
--Guido van Rossum (python.org/~guido)
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to