Skip to content

Commit d4918e1

Browse files
committed
Fixing #64. Bumping version to 3.2.1
1 parent ed3921a commit d4918e1

File tree

8 files changed

+30
-20
lines changed

8 files changed

+30
-20
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# deepdiff v 3.2.0
1+
# deepdiff v 3.2.1
22

33
[![Join the chat at https://gitter.im/deepdiff/Lobby](https://badges.gitter.im/deepdiff/Lobby.svg)](https://gitter.im/deepdiff/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4-
54
<!-- ![Downloads](https://img.shields.io/pypi/dm/deepdiff.svg?style=flat) -->
65
![Python Versions](https://img.shields.io/pypi/pyversions/deepdiff.svg?style=flat)
76
![Doc](https://readthedocs.org/projects/deepdiff/badge/?version=latest)
@@ -795,6 +794,7 @@ And here is more info: <http://zepworks.com/blog/diff-it-to-digg-it/>
795794

796795
##Changelog
797796

797+
- v3-2-1: Fixing hash of None
798798
- v3-2-0: Adding grep for search: object | grep(item)
799799
- v3-1-3: Unicode vs. Bytes default fix
800800
- v3-1-2: NotPresent Fix when item is added or removed.

README.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
**DeepDiff v 3.2.0**
1+
**DeepDiff v 3.2.1**
22

33
Deep Difference of dictionaries, iterables, strings and other objects. It will recursively look for all the changes.
44

@@ -240,6 +240,7 @@ http://zepworks.com/blog/diff-it-to-digg-it/
240240

241241
**Changelog**
242242

243+
- v3-2-1: Fixing hash of None
243244
- v3-2-0: Adding grep for search: object | grep(item)
244245
- v3-1-3: Unicode vs. Bytes default fix
245246
- v3-1-2: NotPresent Fix when item is added or removed.

deepdiff/contenthash.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ class DeepHash(dict):
4444
**DeepHash**
4545
"""
4646

47-
show_warning = True
48-
4947
def __init__(self,
5048
obj,
5149
hashes=None,
@@ -76,7 +74,9 @@ def __init__(self,
7674

7775
self.__hash(obj, parents_ids=frozenset({id(obj)}))
7876

79-
if not self['unprocessed']:
77+
if self['unprocessed']:
78+
logger.warning("Can not hash the following items: {}.".format(self['unprocessed']))
79+
else:
8080
del self['unprocessed']
8181

8282
@staticmethod
@@ -233,6 +233,9 @@ def __hash(self, obj, parent="root", parents_ids=frozenset({})):
233233
if self.__skip_this(obj):
234234
result = self.skipped
235235

236+
elif obj is None:
237+
result = 'NONE'
238+
236239
elif isinstance(obj, strings):
237240
result = self.__hash_str(obj)
238241

deepdiff/diff.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,6 @@ class DeepDiff(ResultDict):
608608
609609
"""
610610

611-
show_warning = True
612-
613611
def __init__(self,
614612
t1,
615613
t2,
@@ -901,7 +899,7 @@ def __diff_str(self, level):
901899
"""Compare strings"""
902900
if level.t1 == level.t2:
903901
return
904-
902+
905903
# do we add a diff for convenience?
906904
do_diff = True
907905
if isinstance(level.t1, bytes_type):

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@
6060
# built documents.
6161
#
6262
# The short X.Y version.
63-
version = '3.2.0'
63+
version = '3.2.1'
6464
# The full version, including alpha/beta/rc tags.
65-
release = '3.2.0'
65+
release = '3.2.1'
6666

6767
# The language for content autogenerated by Sphinx. Refer to documentation
6868
# for a list of supported languages.

docs/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6-
DeepDiff 3.2.0 documentation!
6+
DeepDiff 3.2.1 documentation!
77
=============================
88

99
**DeepDiff: Deep Difference of dictionaries, iterables and almost any other object recursively.**
@@ -346,6 +346,7 @@ Indices and tables
346346
Changelog
347347
=========
348348

349+
- v3-2-1: Fixing hash of None
349350
- v3-2-0: Adding grep for search: object | grep(item)
350351
- v3-1-3: Unicode vs. Bytes default fix
351352
- v3-1-2: NotPresent Fix when item is added or removed.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
long_description = "Deep Difference and Search of any Python object/data."
1414

1515
setup(name='deepdiff',
16-
version='3.2.0',
16+
version='3.2.1',
1717
description='Deep Difference and Search of any Python object/data.',
1818
url='https://github.com/seperman/deepdiff',
1919
download_url='https://github.com/seperman/deepdiff/tarball/master',

tests/test_diff_text.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import datetime
2424
from decimal import Decimal
2525
from deepdiff import DeepDiff
26-
from deepdiff.helper import py3, bytes_type
26+
from deepdiff.helper import py3
2727
from tests import CustomClass
2828
if py3:
2929
from unittest import mock
@@ -177,7 +177,7 @@ def test_string_difference2(self):
177177
}
178178
}
179179
self.assertEqual(ddiff, result)
180-
180+
181181
def test_bytes(self):
182182
t1 = {
183183
1: 1,
@@ -189,11 +189,11 @@ def test_bytes(self):
189189
"c": b"\x80",
190190
}
191191
}
192-
t2 = {1: 1,
193-
2: 2,
194-
3: 3,
192+
t2 = {1: 1,
193+
2: 2,
194+
3: 3,
195195
4: {
196-
"a": b"hello",
196+
"a": b"hello",
197197
"b": b"world\n1\n2\nEnd",
198198
"c": b'\x81',
199199
}
@@ -214,7 +214,7 @@ def test_bytes(self):
214214
}
215215
}
216216
self.assertEqual(ddiff, result)
217-
217+
218218
def test_unicode(self):
219219
t1 = {
220220
1: 1,
@@ -543,6 +543,13 @@ def test_list_of_sets_difference_ignore_order_when_there_is_duplicate_and_mix_of
543543
result = {'iterable_item_added': {'root[0]': {4}}}
544544
self.assertEqual(ddiff, result)
545545

546+
def test_set_of_none(self):
547+
"""
548+
https://github.com/seperman/deepdiff/issues/64
549+
"""
550+
ddiff = DeepDiff(set(), set([None]))
551+
self.assertEqual(ddiff, {'set_item_added': {'root[None]'}})
552+
546553
def test_list_that_contains_dictionary(self):
547554
t1 = {1: 1, 2: 2, 3: 3, 4: {"a": "hello", "b": [1, 2, {1: 1, 2: 2}]}}
548555
t2 = {1: 1, 2: 2, 3: 3, 4: {"a": "hello", "b": [1, 2, {1: 3}]}}

0 commit comments

Comments
 (0)