Skip to content

Commit bd12982

Browse files
committed
Implement None == None
Fixes RustPython#111
1 parent 5f0c8a3 commit bd12982

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

tests/snippets/json_snippet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def round_trip_test(obj):
3838
assert True == json.loads('true')
3939
assert False == json.loads('false')
4040
# TODO: uncomment once None comparison is implemented
41-
# assert None == json.loads('null')
41+
assert None == json.loads('null')
4242
assert [] == json.loads('[]')
4343
assert ['a'] == json.loads('["a"]')
4444
assert [['a'], 'b'] == json.loads('[["a"], "b"]')

vm/src/pyobject.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,7 @@ impl PartialEq for PyObject {
779779
}
780780
}
781781
(PyObjectKind::Boolean { value: a }, PyObjectKind::Boolean { value: b }) => a == b,
782+
(PyObjectKind::None, PyObjectKind::None) => true,
782783
_ => panic!(
783784
"TypeError in COMPARE_OP: can't compare {:?} with {:?}",
784785
self, other

0 commit comments

Comments
 (0)