Implement None == None

Fixes #111
This commit is contained in:
Daniel Watkins
2018-08-31 18:35:00 -04:00
parent 5f0c8a343f
commit bd12982b06
2 changed files with 2 additions and 1 deletions

View File

@@ -38,7 +38,7 @@ assert "str" == json.loads('"str"')
assert True == json.loads('true')
assert False == json.loads('false')
# TODO: uncomment once None comparison is implemented
# assert None == json.loads('null')
assert None == json.loads('null')
assert [] == json.loads('[]')
assert ['a'] == json.loads('["a"]')
assert [['a'], 'b'] == json.loads('[["a"], "b"]')

View File

@@ -779,6 +779,7 @@ impl PartialEq for PyObject {
}
}
(PyObjectKind::Boolean { value: a }, PyObjectKind::Boolean { value: b }) => a == b,
(PyObjectKind::None, PyObjectKind::None) => true,
_ => panic!(
"TypeError in COMPARE_OP: can't compare {:?} with {:?}",
self, other