Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
rhencke
on Oct 5, 2020
|
parent
|
context
|
favorite
| on:
Python 3.9
While nice, this isn't new. This is just a convenience for 'lru_cache(maxsize=None)'. lru_cache has been supported since Python 3.2.
See:
https://docs.python.org/3.2/library/functools.html#functools...
nneonneo
on Oct 5, 2020
[–]
They do mention that it’s more efficient than lru_cache, which isn’t surprising since cache is a lot simpler (just throw all the values in a dict keyed by the args).
uyt
on Oct 5, 2020
|
parent
|
next
[–]
No they are saying it's more efficiently that lru_cache with a finite maxsize. Implementation-wise it's identical to using maxsize=None. See source:
https://github.com/python/cpython/blob/3.9/Lib/functools.py#...
dralley
on Oct 5, 2020
|
parent
|
prev
[–]
It says it's more efficient than lru_cache with a size specified, it doesn't say that it's more efficient than lru_cache without one.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
See: https://docs.python.org/3.2/library/functools.html#functools...