Open mitar opened 2 years ago
Definitely, the Python 3.6 variant looks correct to me. I will consider this a proper bug to be fixed.
Another set. Python 3.6:
>>> import typing
>>> from pytypes import type_util
>>> class Foo(dict):
... pass
...
>>> type_util._issubclass(type_util.deep_type({}), dict)
True
>>> type_util._issubclass(type_util.deep_type({}), typing.Dict)
True
>>> type_util._issubclass(type_util.deep_type(Foo()), typing.Dict)
True
Python 3.8:
>>> import typing
>>> from pytypes import type_util
>>> class Foo(dict):
... pass
...
>>> type_util._issubclass(type_util.deep_type({}), dict)
True
>>> type_util._issubclass(type_util.deep_type({}), typing.Dict)
True
>>> type_util._issubclass(type_util.deep_type(Foo()), typing.Dict)
False
Another difference. It should be True
, but on Python 3.8 returns False
.
type_util._issubclass(type_util.deep_type([{'cc': 1, 'dd': 2}, {'ee': 1, 'ff': 2}]), typing.Sequence[object])
I know that Python 3.7/3.8 support is still in progress and I was testing the
master
branch and found some differences so I am reporting them to maybe use them as unit tests. With Python 3.6:Python 3.8: