diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt index 33e0fceadf..438a38cea0 100644 --- a/docs/ref/utils.txt +++ b/docs/ref/utils.txt @@ -521,7 +521,7 @@ https://web.archive.org/web/20110718035220/http://diveintomark.org/archives/2004 The cached value can be treated like an ordinary attribute of the instance:: # clear it, requiring re-computation next time it's called - del person.friends # or delattr(person, "friends") + person.__dict__.pop("friends", None) # set a value manually, that will persist on the instance until cleared person.friends = ["Huckleberry Finn", "Tom Sawyer"]