Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError when compared to None #201

Closed
MyrikLD opened this issue Jun 25, 2020 · 2 comments
Closed

TypeError when compared to None #201

MyrikLD opened this issue Jun 25, 2020 · 2 comments
Assignees
Labels

Comments

@MyrikLD
Copy link
Contributor

MyrikLD commented Jun 25, 2020

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

@seperman
Copy link
Owner

seperman commented Jul 7, 2020

Hi @MyrikLD
Thanks for reporting this bug. I will fix it when I have a chance.
Thanks,
Sep

@seperman seperman self-assigned this Jul 7, 2020
@seperman seperman added the bug label Jul 7, 2020
@seperman
Copy link
Owner

Thanks @MyrikLD
DeepDiff 5.0.2 is released with your bugfix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants