| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
@ilevkivskyi Do you see anything wrong with this? |
Sorry, something went wrong.
| AnyStr = TypeVar('AnyStr', bytes, unicode) | ||
|
|
||
|
|
||
| def _tp_cache(func, maxsize=128): |
There was a problem hiding this comment.
A small comment: With this definition we could not later write:
@_tp_cache(maxsize=200)
def __getitem__(self, parameters):
...This causes an error (function takes at least 1 argument...). I would propose to either make maxsize a constant MAXSIZE or use the decorator with args pattern here.
Except for this small comment, everything LGTM.
Sorry, something went wrong.
|
It's not tunable in the Python 3 version either, so I just made it a local. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #290. Timing example:
Without cache:
With cache:
That's about a 300x speedup!