On Tue, 12 Apr 2016 at 10:18 Nikolaus Rath <Nikolaus@rath.org> wrote:
On Apr 11 2016, Ethan Furman <ethan-gcWI5d7PMXnvaiG9KC9N7Q@public.gmane.org> wrote:
>> As far as I can see, implementing a protocol instead of adding a few
>> isinstance checks is more likely to make the life of a CPython developer
>> harder than easier.
>
> I disagree.  And the protocol idea was not mine, so apparently other
> core-devs also disagree (or think it's worth it, regardless).

I haven't found any email explaining why a protocol would make things
easier than the isinstance() approach (and I read most of the threads
both here and on -dev), so I was assuming that the core-devs in question
don't disagree but haven't considered the second approach.

I disagree with the idea. :) Type checking tends to be too strict as it prevents duck typing. And locking ourselves to only what's in the stdlib is way too restrictive when there are alternative path libraries out there already. Plus it's short-sighted to assume no one will ever come up with a better path library, and so tying us down to only pathlib.PurePath explicitly would be a mistake long-term when specifying a single method keeps things flexible (this is the same reason __index__() exists and we simply don't say indexing has to be with a subclass of int or something).

-Brett