<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, 12 Apr 2016 at 10:18 Nikolaus Rath <<a href="mailto:Nikolaus@rath.org">Nikolaus@rath.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Apr 11 2016, Ethan Furman <<a href="mailto:ethan-gcWI5d7PMXnvaiG9KC9N7Q@public.gmane.org" target="_blank">ethan-gcWI5d7PMXnvaiG9KC9N7Q@public.gmane.org</a>> wrote:<br>
>> As far as I can see, implementing a protocol instead of adding a few<br>
>> isinstance checks is more likely to make the life of a CPython developer<br>
>> harder than easier.<br>
><br>
> I disagree. And the protocol idea was not mine, so apparently other<br>
> core-devs also disagree (or think it's worth it, regardless).<br>
<br>
I haven't found any email explaining why a protocol would make things<br>
easier than the isinstance() approach (and I read most of the threads<br>
both here and on -dev), so I was assuming that the core-devs in question<br>
don't disagree but haven't considered the second approach.<br></blockquote><div><br></div><div>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).</div><div><br></div><div>-Brett</div></div></div>