Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

I understand the confusion, but this isn't a bug.

Specifying "typed=True" means that the cache is required to treat the calls 
f(1) and f(1.0) as distinct.

However, specifying or defaulting to "typed=False" means that the cache isn't 
required to do so, but it is still allowed to.

This flexibility allowed the tool to add a space saving path for *int*.  It 
comes at the expense of leaving equivalent int/float calls as distinct.  Most 
apps win here because it is typical to keep the type the same across calls.  
Also, the saved space may allow users to choose a larger value for *maxsize*.

Note, similar liberties were taken with keyword argument ordering.  Formerly, 
f(a=1, b=2) was considered equivalent to f(b=1, a=1).  Now, they are treated as 
distinct.  The downside is a potential extra call.  The upside is that we save 
the huge overhead of sorting the keyword arguments.  Mostly, this is a net win, 
despite the visible change in cache utilization statistics.

----------
nosy: +rhettinger
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39554>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to