params: make python and c++ API match (#25573)

* params: make python and c++ API match

* few more
This commit is contained in:
Adeeb Shihadeh
2022-08-26 20:46:19 -07:00
committed by GitHub
parent c626198575
commit 90a4565eb2
16 changed files with 24 additions and 24 deletions
+1 -1
View File
@@ -90,7 +90,7 @@ cdef class Params:
with nogil:
self.p.putBool(k, val)
def delete(self, key):
def remove(self, key):
cdef string k = self.check_key(key)
with nogil:
self.p.remove(k)
+3 -3
View File
@@ -59,13 +59,13 @@ class TestParams(unittest.TestCase):
with self.assertRaises(UnknownKeyName):
self.params.put_bool("swag", True)
def test_delete_not_there(self):
def test_remove_not_there(self):
assert self.params.get("CarParams") is None
self.params.delete("CarParams")
self.params.remove("CarParams")
assert self.params.get("CarParams") is None
def test_get_bool(self):
self.params.delete("IsMetric")
self.params.remove("IsMetric")
self.assertFalse(self.params.get_bool("IsMetric"))
self.params.put_bool("IsMetric", True)