Greetings, friends!

We just added lru_cache in Django. 
https://github.com/django/django/commit/9b7455e918a437c3db91e88dcbf6d9c93fef96f8

As you can see in django/utils/lru_cache.py, if Python is not shipped with 
lru_cache (Python 3.1 for example), we provide lru_cache for them. This 
lru_cache is just a backport from Python 3.3 lru_cache. 
http://code.activestate.com/recipes/578078-py26-and-py30-backport-of-python-33s-lru-cache/

The problem happens if we use Python 3.2. Python 3.2 comes with lru_cache 
which is inferior from our lru_cache. 
http://hg.python.org/releasing/3.2.4/file/7680dbf5cb3f/Lib/functools.py. 
Should we detect this corner case so if user uses Python 3.2, we overshadow 
their "inferior" lru_cache?

According to Raymond Hettinger (Python core developer) who wrote lru_cache:

"The Python 3.3 version was also refactored, beautified, and optimized. It 
consumes less memory than the 3.2 version. It makes half as many hash 
calls."

In my opinion, we should just use "inferior" version of lru_cache in Python 
3.2 I bet the difference would be unnoticeable. But I am just curious what 
Django developers think about this.

Cheers,
Vajrasky

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/ca33baf4-6ca1-4abf-a058-d993b3dd1271%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to