New submission from Nick Coghlan ncogh...@gmail.com:
As per private email to Raymond, I would like to move the lru_cache access
attributes and methods into a CacheInfo class, exposed as a cache attribute
with several methods and read-only properties.
Read-only properties: hits, misses,
Nick Coghlan ncogh...@gmail.com added the comment:
Raymond suggested a simple cache_info() method that returns a named tuple as a
possible alternative.
I like that idea, as it makes displaying debugging information (the intended
use case for these attributes) absolutely trivial:
import
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Okay, go ahead with the second patch.
With the following changes:
_CacheInfo = namedtuple(CacheInfo, maxsize size hits misses)
Change the variable names:
cache_hits -- hits
cache_misses -- misses
Add a
Nick Coghlan ncogh...@gmail.com added the comment:
Committed in r86878.
I put a XXX note in the relevant part of the 3.2 What's New rather than
updating it directly.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10586
Changes by Nick Coghlan ncogh...@gmail.com:
--
stage: - committed/rejected
status: open - closed
type: - feature request
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10586
___
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Thx
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10586
___
___