8000 Clarify that this sentence applies to the above example. GH-32405 · python/cpython@f4b328e · GitHub
[go: up one dir, main page]

Skip to content

Commit f4b328e

Browse files
authored
Clarify that this sentence applies to the above example. GH-32405
1 parent e2d78ba commit f4b328e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Doc/faq/programming.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1951,9 +1951,9 @@ relevant instance attributes are mutable, the *cached_property* approach
19511951
can't be made to work because it cannot detect changes to the
19521952
attributes.
19531953

1954-
The *lru_cache* approach can be made to work, but the class needs to define the
1955-
*__eq__* and *__hash__* methods so the cache can detect relevant attribute
1956-
updates::
1954+
To make the *lru_cache* approach work when the *station_id* is mutable,
1955+
the class needs to define the *__eq__* and *__hash__* methods so that
1956+
the cache can detect relevant attribute updates::
19571957

19581958
class Weather:
19591959
"Example with a mutable station identifier"

0 commit comments

Comments
 (0)
0