<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Oct 18, 2018 at 10:12 AM, Sven R. Kunze <span dir="ltr"><<a href="mailto:srkunze@mail.de" target="_blank">srkunze@mail.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 18.10.18 18:49, Anders Hovmöller wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If it's AND, shouldn't it be "hasinterfaces" (notice the s!)?</blockquote></span></blockquote><div><br></div><div>yeah, that would make sense.</div><div> </div><div>Is someone proposing something here? The point I was making, is in the case of ABCs:</div><div><br></div><div>issubclass(a_class, an_abc)</div><div><br></div><div>isn't "Really" testing a subclass, but really an interface. That is - the ABC exists solely to define an interface, not provide any functionality (though there is some in there), and you can, in fact, use ABCs to provide a way to check a duck-typed class that isn't an actual subclass.</div><div><br></div><div>So do we need a new function that makes that clear? would it functionally be an different than issubclass with an ABC?</div><div><br></div><div>I honestly don't know.</div><div><br></div><div>Though an easy way to get the "and" behaviour -- i.e. interfaceS would be nice.</div><div><br></div><div>-CHB</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
To be sure, we are on the same page here: "interface" refers to a set of attributes of the object in question, does it?<br>
<br>
E.g. like the __iter__ iterface. I usually don't care about the actual inheritance hierarchy but care about functionality.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
One could also imagine that isinstance and issubclass taking a keyword argument for the logical operator. Maybe just something as simple as "isinstance(foo, (a, b), all=True)"<br>
</blockquote>
<br></span>
Does AND even make sense for isinstance/issubclass?<br>
<br>
Cheers,<br>
Sven<div class="HOEnZb"><div class="h5"><br>
<br>
______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofco<wbr>nduct/</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R            (206) 526-6959   voice<br>7600 Sand Point Way NE   (206) 526-6329   fax<br>Seattle, WA  98115       (206) 526-6317   main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</div></div>