mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-12 17:26:13 +00:00
clarified pickle version requirements (fixes #186)
This commit is contained in:
@@ -14,7 +14,7 @@ p = Pickleable("test_value")
|
||||
p.setExtra1(15)
|
||||
p.setExtra2(48)
|
||||
|
||||
data = pickle.dumps(p, -1) # -1 is important (use highest protocol version)
|
||||
data = pickle.dumps(p, 2) # Must use pickle protocol >= 2
|
||||
print("%s %i %i" % (p.value(), p.extra1(), p.extra2()))
|
||||
|
||||
p2 = pickle.loads(data)
|
||||
|
||||
Reference in New Issue
Block a user