<div dir="ltr"><div>First, the typing module is still provisional, so there is no strict backwards compatibility guarantee.</div><div><br></div><div>With that out of the way, I can reproduce your problem, and I assume it's caused by the implementation of PEP 560, which is meant to speed up the typing module (among other goals).</div><div><br></div><div>I'm wondering about your claim that this breaks many "libraries that use annotations". Most code using annotations would not need to use issubclass() in this way. Where exactly did you encounter this?</div><div><br></div><div>I'm CC'ing Ivan Levkivskyi, who knows the relevant code better and will be able to explain whether this is an oversight or an intentional regression.<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Jun 23, 2018 at 2:59 PM Rokker Ruslan <<a href="mailto:rokkerruslan@yandex.com">rokkerruslan@yandex.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>Python 3.7 in the status of RC, but I do not see information about the fact that python3.7 is backwards incompatible with python3.5.</div><div> </div><div>$ ~ python3.5</div><div>Python 3.5.2 (default, Nov 23 2017, 16:37:01) </div><div>[GCC 5.4.0 20160609] on linux</div><div>Type "help", "copyright", "credits" or "license" for more information.</div><div>>>> from typing import List</div><div>>>> class MyList(list):</div><div>...     pass</div><div>... </div><div>>>> issubclass(MyList, List)</div><div>True</div><div>>>> issubclass(List, MyList)</div><div>False</div><div>>>></div><div> </div><div>$ ~ python3.7</div><div>Python 3.7.0rc1+ (heads/3.7:3747dd16d5, Jun 22 2018, 22:53:42) </div><div>[GCC 5.4.0 20160609] on linux</div><div>Type "help", "copyright", "credits" or "license" for more information.</div><div>>>> from typing import List</div><div>>>> class MyList(list):</div><div>...     pass</div><div>... </div><div>>>> issubclass(MyList, List)</div><div>True</div><div>>>> issubclass(List, MyList)</div><div>Traceback (most recent call last):</div><div>  File "<stdin>", line 1, in <module></div><div>TypeError: issubclass() arg 1 must be a class</div><div>>>></div><div> </div><div>And so with all types of "typing" module.</div><div>This breaks down many libraries that use annotations as part of the functionality if we now can't use typing.* into issubclass function.</div></div>_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/guido%40python.org" rel="noreferrer" target="_blank">https://mail.python.org/mailman/options/python-dev/guido%40python.org</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido">python.org/~guido</a>)</div>