MCPcopy Index your code
hub / github.com/cloudpipe/cloudpickle / test_unhashable_closure

Method test_unhashable_closure

tests/cloudpickle_test.py:327–337  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

325 g2()
326
327 def test_unhashable_closure(self):
328 def f():
329 s = {1, 2} # mutable set is unhashable
330
331 def g():
332 return len(s)
333
334 return g
335
336 g = pickle_depickle(f(), protocol=self.protocol)
337 self.assertEqual(g(), 2)
338
339 def test_class_no_firstlineno_deletion_(self):
340 # `__firstlineno__` is a new attribute of classes introduced in Python 3.13.

Callers

nothing calls this directly

Calls 3

pickle_depickleFunction · 0.85
fFunction · 0.85
gFunction · 0.70

Tested by

no test coverage detected