You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suspect, based on a reading of the source code, that there may be a documentation mistake in the section on memoize. It says
Memoize is also designed for methods, since it will take into account the identity. of the ‘self’ or ‘cls’ argument as part of the cache key.
The link there goes to the python standard library id function, which refers to an object's location in memory. For e.g. a database object, this would be unique each time the object is loaded. However, when I look at the code, this appears to rely on the following function, found here:
The __caching_id__ or repr result would likely be much more stable. Can someone please confirm that this is how memoize is intended to work? If so, the documentation should be changed to remove the link (and ideally make mention of the correct interpretation of "identity")--I'd be happy to do so in that case.
Thanks!
The text was updated successfully, but these errors were encountered:
I suspect, based on a reading of the source code, that there may be a documentation mistake in the section on
memoize
. It saysThe link there goes to the python standard library
id
function, which refers to an object's location in memory. For e.g. a database object, this would be unique each time the object is loaded. However, when I look at the code, this appears to rely on the following function, found here:The
__caching_id__
orrepr
result would likely be much more stable. Can someone please confirm that this is howmemoize
is intended to work? If so, the documentation should be changed to remove the link (and ideally make mention of the correct interpretation of "identity")--I'd be happy to do so in that case.Thanks!
The text was updated successfully, but these errors were encountered: