title: Python: How can I ignore a special parameter in functools.lru_cache?
body: <p>The function that I want to cache is something like:</p>
  
  <pre><code>def a(x, time='last'):
  </code></pre>
  
  <p>I have deterministic behaviour for every <code>a(x,y)</code>, except when <code>y=='last'</code>. So when <code>a(x, 'last')</code> is called, I would like to call the "real thing" and an lru_cached function for everything else.</p>
  
  <p>I imagine this could be possible with my own decorator:</p>
  
  <pre><code>def my_lru_cache(func):
      def function_wrapper(*args, **kwargs):
          if kwargs is not None:
              if 'time' in kwargs:
                  return func(*args, **kwargs)
              else:
                  return what?!?
  
      return function_wrapper
  </code></pre>
  
  <p>Am I completely wrong? How could this be done?</p>