Skip to content

TypeError when compared to None #201

@MyrikLD

Description

@MyrikLD

Describe the bug
Rises exception when tries to compare None with any another type:

  File "~/.config/JetBrains/PyCharm2020.1/scratches/scratch_48.py", line 3, in <module>
    DeepDiff(
  File "~/.local/share/virtualenvs/settings-lLIjx0Rq/lib/python3.8/site-packages/deepdiff/diff.py", line 259, in __init__
    self.__diff(root, parents_ids=frozenset({id(t1)}), _original_type=_original_type)
  File "~/.local/share/virtualenvs/settings-lLIjx0Rq/lib/python3.8/site-packages/deepdiff/diff.py", line 1159, in __diff
    self.__diff_dict(level, parents_ids)
  File "~/.local/share/virtualenvs/settings-lLIjx0Rq/lib/python3.8/site-packages/deepdiff/diff.py", line 492, in __diff_dict
    self.__diff(next_level, parents_ids_added)
  File "~/.local/share/virtualenvs/settings-lLIjx0Rq/lib/python3.8/site-packages/deepdiff/diff.py", line 1136, in __diff
    if self.type_check_func(level.t1, type_group) and self.type_check_func(level.t2, type_group):
  File "~/.local/share/virtualenvs/settings-lLIjx0Rq/lib/python3.8/site-packages/deepdiff/helper.py", line 312, in type_is_subclass_of_type_group
    return isinstance(item, type_group) or issubclass(item, type_group) or type_in_type_group(item, type_group)
TypeError: issubclass() arg 1 must be a class

To Reproduce

DeepDiff({'a':None},{'a':1}, ignore_type_subclasses=True, ignore_type_in_groups=[(int, float)])

OS, DeepDiff version and Python version:
OS: Manjaro Linux
Version:
Python: 3.8.3
Deepdiff: 5.0.0

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions