Skip to content

Commit

Permalink
Updated docs example to clear cached_property without raising Attribu…
Browse files Browse the repository at this point in the history
…teError.

Signed-off-by: SaJH <[email protected]>
  • Loading branch information
JaeHyuckSa authored and sarahboyce committed Dec 2, 2024
1 parent b8f9f62 commit b0d9c1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/ref/utils.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit b0d9c1f

Please sign in to comment.