diff --git a/special-method-names.html b/special-method-names.html index e1d7264..6d77ecb 100644 --- a/special-method-names.html +++ b/special-method-names.html @@ -703,16 +703,18 @@ class FieldStorage:
pickle.dump(x, file, protocol_version)
x.__reduce_ex__(protocol_version)
-x = pickle.load(file)
x.__getnewargs__()
-x = pickle.load(file)
x.__setstate__()
+* To recreate a serialized object, Python needs to create a new object that looks like the serialized object, then set the values of all the attributes on the new object. The __getnewargs__() method controls how the object is created, then the __setstate__() method controls how the attribute values are restored.
+
with BlockPython 3 supports the with statement, which allows you to access an object’s properties and methods without explicitly referencing the object every time. A with block defines a runtime context; you “enter” the context when you execute the with statement, and you “exit” the context after you execute the last statement in the block.