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.
 
$ ~ python3.5
Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from typing import List
>>> class MyList(list):
...     pass
... 
>>> issubclass(MyList, List)
True
>>> issubclass(List, MyList)
False
>>>
 
$ ~ python3.7
Python 3.7.0rc1+ (heads/3.7:3747dd16d5, Jun 22 2018, 22:53:42) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from typing import List
>>> class MyList(list):
...     pass
... 
>>> issubclass(MyList, List)
True
>>> issubclass(List, MyList)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: issubclass() arg 1 must be a class
>>>
 
And so with all types of "typing" module.
This breaks down many libraries that use annotations as part of the functionality if we now can't use typing.* into issubclass function.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to