Mercurial > cpython-lru_cache-weakref
annotate Doc/tools/sphinxext/layout.html @ 87690:66c1c9f32567 default tip
Add use_weakref option to functools.lru_cache
The use_weakref option makes lru_cache create weak references to the function
arguments when creating the cache key, which prevents them from staying in the
memory forever even after all other references to them are gone.
This is a proof of concept for http://bugs.python.org/issue19859
| author | Radomir Dopieralski <devel@sheep.art.pl> |
|---|---|
| date | Tue, 03 Dec 2013 16:02:48 +0100 |
| parents | 9505a34b4484 |
| children |
| rev | line source |
|---|---|
|
46648
5bb94065b079
Merge OpenSearch-related changes.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
1 {% extends "!layout.html" %} |
|
5bb94065b079
Merge OpenSearch-related changes.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
2 {% block rootrellink %} |
|
50078
63ee6a0f7358
Manual merge of r67636 from py3k branch:
Georg Brandl <georg@python.org>
parents:
49493
diff
changeset
|
3 <li><img src="{{ pathto('_static/py.png', 1) }}" alt="" |
|
63ee6a0f7358
Manual merge of r67636 from py3k branch:
Georg Brandl <georg@python.org>
parents:
49493
diff
changeset
|
4 style="vertical-align: middle; margin-top: -1px"/></li> |
|
75932
ca0230c21c79
Switch to new "lighter" doc design.
Georg Brandl <georg@python.org>
parents:
75813
diff
changeset
|
5 <li><a href="http://www.python.org/">Python</a>{{ reldelim1 }}</li> |
|
79976
35a2a0e166d0
#8040: add a version switcher to the documentation. Patch by Yury Selivanov.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
75932
diff
changeset
|
6 <li> |
|
35a2a0e166d0
#8040: add a version switcher to the documentation. Patch by Yury Selivanov.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
75932
diff
changeset
|
7 {%- if versionswitcher is defined %} |
|
35a2a0e166d0
#8040: add a version switcher to the documentation. Patch by Yury Selivanov.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
75932
diff
changeset
|
8 <span class="version_switcher_placeholder">{{ release }}</span> |
|
35a2a0e166d0
#8040: add a version switcher to the documentation. Patch by Yury Selivanov.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
75932
diff
changeset
|
9 <a href="{{ pathto('index') }}">Documentation</a>{{ reldelim1 }} |
|
35a2a0e166d0
#8040: add a version switcher to the documentation. Patch by Yury Selivanov.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
75932
diff
changeset
|
10 {%- else %} |
|
35a2a0e166d0
#8040: add a version switcher to the documentation. Patch by Yury Selivanov.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
75932
diff
changeset
|
11 <a href="{{ pathto('index') }}">{{ shorttitle }}</a>{{ reldelim1 }} |
|
35a2a0e166d0
#8040: add a version switcher to the documentation. Patch by Yury Selivanov.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
75932
diff
changeset
|
12 {%- endif %} |
|
35a2a0e166d0
#8040: add a version switcher to the documentation. Patch by Yury Selivanov.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
75932
diff
changeset
|
13 </li> |
|
46648
5bb94065b079
Merge OpenSearch-related changes.
Georg Brandl <georg@python.org>
parents:
diff
changeset
|
14 {% endblock %} |
|
50078
63ee6a0f7358
Manual merge of r67636 from py3k branch:
Georg Brandl <georg@python.org>
parents:
49493
diff
changeset
|
15 {% block extrahead %} |
|
63ee6a0f7358
Manual merge of r67636 from py3k branch:
Georg Brandl <georg@python.org>
parents:
49493
diff
changeset
|
16 <link rel="shortcut icon" type="image/png" href="{{ pathto('_static/py.png', 1) }}" /> |
|
75813
b585c33077d2
#14114: don't include copybutton.js in the htmlhelp output.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
73196
diff
changeset
|
17 {% if not embedded %}<script type="text/javascript" src="{{ pathto('_static/copybutton.js', 1) }}"></script>{% endif %} |
|
79976
35a2a0e166d0
#8040: add a version switcher to the documentation. Patch by Yury Selivanov.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
75932
diff
changeset
|
18 {% if versionswitcher is defined and not embedded %}<script type="text/javascript" src="{{ pathto('_static/version_switch.js', 1) }}"></script>{% endif %} |
| 79375 | 19 {% if pagename == 'whatsnew/changelog' %} |
|
79321
6347fb67239a
Add a filterable HTML version of Misc/NEWS to the docs "whatsnew" section.
Georg Brandl <georg@python.org>
parents:
75932
diff
changeset
|
20 <script type="text/javascript"> |
|
79391
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
21 $(document).ready(function() { |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
22 // add the search form and bind the events |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
23 $('h1').after([ |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
24 '<p>Filter entries by content:', |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
25 '<input type="text" value="" id="searchbox" style="width: 50%">', |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
26 '<input type="submit" id="searchbox-submit" value="Filter"></p>' |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
27 ].join('\n')); |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
28 |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
29 function dofilter() { |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
30 try { |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
31 var query = new RegExp($('#searchbox').val(), 'i'); |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
32 } |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
33 catch (e) { |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
34 return; // not a valid regex (yet) |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
35 } |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
36 // find headers for the versions (What's new in Python X.Y.Z?) |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
37 $('#changelog h2').each(function(index1, h2) { |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
38 var h2_parent = $(h2).parent(); |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
39 var sections_found = 0; |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
40 // find headers for the sections (Core, Library, etc.) |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
41 h2_parent.find('h3').each(function(index2, h3) { |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
42 var h3_parent = $(h3).parent(); |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
43 var entries_found = 0; |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
44 // find all the entries |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
45 h3_parent.find('li').each(function(index3, li) { |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
46 var li = $(li); |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
47 // check if the query matches the entry |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
48 if (query.test(li.text())) { |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
49 li.show(); |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
50 entries_found++; |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
51 } |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
52 else { |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
53 li.hide(); |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
54 } |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
55 }); |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
56 // if there are entries, show the section, otherwise hide it |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
57 if (entries_found > 0) { |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
58 h3_parent.show(); |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
59 sections_found++; |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
60 } |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
61 else { |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
62 h3_parent.hide(); |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
63 } |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
64 }); |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
65 if (sections_found > 0) |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
66 h2_parent.show(); |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
67 else |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
68 h2_parent.hide(); |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
69 }); |
|
79321
6347fb67239a
Add a filterable HTML version of Misc/NEWS to the docs "whatsnew" section.
Georg Brandl <georg@python.org>
parents:
75932
diff
changeset
|
70 } |
|
79391
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
71 $('#searchbox').keyup(dofilter); |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
72 $('#searchbox-submit').click(dofilter); |
|
e9c28d6983f4
Fix/improve the changelog filtering.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
79375
diff
changeset
|
73 }); |
|
79321
6347fb67239a
Add a filterable HTML version of Misc/NEWS to the docs "whatsnew" section.
Georg Brandl <georg@python.org>
parents:
75932
diff
changeset
|
74 </script> |
|
6347fb67239a
Add a filterable HTML version of Misc/NEWS to the docs "whatsnew" section.
Georg Brandl <georg@python.org>
parents:
75932
diff
changeset
|
75 {% endif %} |
|
50078
63ee6a0f7358
Manual merge of r67636 from py3k branch:
Georg Brandl <georg@python.org>
parents:
49493
diff
changeset
|
76 {{ super() }} |
|
63ee6a0f7358
Manual merge of r67636 from py3k branch:
Georg Brandl <georg@python.org>
parents:
49493
diff
changeset
|
77 {% endblock %} |
|
55545
3ff1725f837e
Merged revisions 74309 via svnmerge from
Georg Brandl <georg@python.org>
parents:
50078
diff
changeset
|
78 {% block footer %} |
|
3ff1725f837e
Merged revisions 74309 via svnmerge from
Georg Brandl <georg@python.org>
parents:
50078
diff
changeset
|
79 <div class="footer"> |
|
3ff1725f837e
Merged revisions 74309 via svnmerge from
Georg Brandl <georg@python.org>
parents:
50078
diff
changeset
|
80 © <a href="{{ pathto('copyright') }}">Copyright</a> {{ copyright|e }}. |
|
3ff1725f837e
Merged revisions 74309 via svnmerge from
Georg Brandl <georg@python.org>
parents:
50078
diff
changeset
|
81 <br /> |
|
79976
35a2a0e166d0
#8040: add a version switcher to the documentation. Patch by Yury Selivanov.
Ezio Melotti <ezio.melotti@gmail.com>
parents:
75932
diff
changeset
|
82 The Python Software Foundation is a non-profit corporation. |
|
55545
3ff1725f837e
Merged revisions 74309 via svnmerge from
Georg Brandl <georg@python.org>
parents:
50078
diff
changeset
|
83 <a href="http://www.python.org/psf/donations/">Please donate.</a> |
|
3ff1725f837e
Merged revisions 74309 via svnmerge from
Georg Brandl <georg@python.org>
parents:
50078
diff
changeset
|
84 <br /> |
|
3ff1725f837e
Merged revisions 74309 via svnmerge from
Georg Brandl <georg@python.org>
parents:
50078
diff
changeset
|
85 Last updated on {{ last_updated|e }}. |
|
60881
54526eec8bc6
Merged revisions 80390 via svnmerge from
Georg Brandl <georg@python.org>
parents:
55545
diff
changeset
|
86 <a href="{{ pathto('bugs') }}">Found a bug</a>? |
|
54526eec8bc6
Merged revisions 80390 via svnmerge from
Georg Brandl <georg@python.org>
parents:
55545
diff
changeset
|
87 <br /> |
|
55545
3ff1725f837e
Merged revisions 74309 via svnmerge from
Georg Brandl <georg@python.org>
parents:
50078
diff
changeset
|
88 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version|e }}. |
|
3ff1725f837e
Merged revisions 74309 via svnmerge from
Georg Brandl <georg@python.org>
parents:
50078
diff
changeset
|
89 </div> |
|
3ff1725f837e
Merged revisions 74309 via svnmerge from
Georg Brandl <georg@python.org>
parents:
50078
diff
changeset
|
90 {% endblock %} |
|
60881
54526eec8bc6
Merged revisions 80390 via svnmerge from
Georg Brandl <georg@python.org>
parents:
55545
diff
changeset
|
91 {% block sidebarsourcelink %} |
|
54526eec8bc6
Merged revisions 80390 via svnmerge from
Georg Brandl <georg@python.org>
parents:
55545
diff
changeset
|
92 {%- if show_source and has_source and sourcename %} |
|
54526eec8bc6
Merged revisions 80390 via svnmerge from
Georg Brandl <georg@python.org>
parents:
55545
diff
changeset
|
93 <h3>{{ _('This Page') }}</h3> |
|
54526eec8bc6
Merged revisions 80390 via svnmerge from
Georg Brandl <georg@python.org>
parents:
55545
diff
changeset
|
94 <ul class="this-page-menu"> |
|
54526eec8bc6
Merged revisions 80390 via svnmerge from
Georg Brandl <georg@python.org>
parents:
55545
diff
changeset
|
95 <li><a href="{{ pathto('bugs') }}">Report a Bug</a></li> |
|
54526eec8bc6
Merged revisions 80390 via svnmerge from
Georg Brandl <georg@python.org>
parents:
55545
diff
changeset
|
96 <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}" |
|
54526eec8bc6
Merged revisions 80390 via svnmerge from
Georg Brandl <georg@python.org>
parents:
55545
diff
changeset
|
97 rel="nofollow">Show Source</a></li> |
|
54526eec8bc6
Merged revisions 80390 via svnmerge from
Georg Brandl <georg@python.org>
parents:
55545
diff
changeset
|
98 </ul> |
|
54526eec8bc6
Merged revisions 80390 via svnmerge from
Georg Brandl <georg@python.org>
parents:
55545
diff
changeset
|
99 {%- endif %} |
|
54526eec8bc6
Merged revisions 80390 via svnmerge from
Georg Brandl <georg@python.org>
parents:
55545
diff
changeset
|
100 {% endblock %} |
