MCPcopy Create free account
hub / github.com/HypothesisWorks/hypothesis / move

Method move

hypothesis/src/hypothesis/database.py:255–269  ·  view source on GitHub ↗

Move ``value`` from key ``src`` to key ``dest``. Equivalent to ``delete(src, value)`` followed by ``save(src, value)``, but may have a more efficient implementation. Note that ``value`` will be inserted at ``dest`` regardless of whether it is currently pres

(self, src: bytes, dest: bytes, value: bytes)

Source from the content-addressed store, hash-verified

253 raise NotImplementedError(f"{type(self).__name__}.delete")
254
255 def move(self, src: bytes, dest: bytes, value: bytes) -> None:
256 """
257 Move ``value`` from key ``src`` to key ``dest``.
258
259 Equivalent to ``delete(src, value)`` followed by ``save(src, value)``,
260 but may have a more efficient implementation.
261
262 Note that ``value`` will be inserted at ``dest`` regardless of whether
263 it is currently present at ``src``.
264 """
265 if src == dest:
266 self.save(src, value)
267 return
268 self.delete(src, value)
269 self.save(dest, value)
270
271 def add_listener(self, f: ListenerT, /) -> None:
272 """

Callers 1

moveMethod · 0.45

Calls 2

saveMethod · 0.95
deleteMethod · 0.95

Tested by

no test coverage detected