diff --git a/special-method-names.html b/special-method-names.html index 14ff127..22a860b 100644 --- a/special-method-names.html +++ b/special-method-names.html @@ -306,19 +306,19 @@ class FieldStorage:
x[key]
-x.__getitem__('key')
+x.__getitem__(key)
x[key] = value
-x.__setitem__('key', value)
+x.__setitem__(key, value)
del x[key]
-x.__delitem__('key')
+x.__delitem__(key)
x[nonexistent_key]
-x.__missing__('nonexistent_key')
+x.__missing__(nonexistent_key)
The FieldStorage class from the cgi module also defines these special methods, which means you can do things like this: