Merge pull request #118 from OddBloke/none

Implement None == None
This commit is contained in:
Windel Bouwman
2018-09-01 08:42:49 +02:00
committed by GitHub
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