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
Looking at the traceback, it appears that the move_to_end() call shouldn't occur if the default value was returned, but there's no way to know whether the value returned is the default or just happened to exist in the cache with the same value as the default. Maybe _get() needs to return an is_default bool?
Ubuntu 14.04
The text was updated successfully, but these errors were encountered:
MrCreosote
changed the title
get() with default throws KeyError
LRU cache get() with default throws KeyError
Jul 31, 2018
MrCreosote
changed the title
LRU cache get() with default throws KeyError
LRU cache add() throws KeyError
Jul 31, 2018
Maybe I'm not understanding the semantics, but this is not what I would expect:
Looking at the traceback, it appears that the move_to_end() call shouldn't occur if the default value was returned, but there's no way to know whether the value returned is the default or just happened to exist in the cache with the same value as the default. Maybe _get() needs to return an is_default bool?
Ubuntu 14.04
The text was updated successfully, but these errors were encountered: