Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /doc/html/about_pyke/cooking_functions.html [9ac085] .. [0176eb] Maximize Restore

  Switch to unified view

a/doc/html/about_pyke/cooking_functions.html b/doc/html/about_pyke/cooking_functions.html
...
...
80
<p>First you define the function that you want to cook with an extra parameter
80
<p>First you define the function that you want to cook with an extra parameter
81
at the start:</p>
81
at the start:</p>
82
<blockquote>
82
<blockquote>
83
<pre class="doctest-block">
83
<pre class="doctest-block">
84
&gt;&gt;&gt; def foo(cooked, standard):
84
&gt;&gt;&gt; def foo(cooked, standard):
85
...     print &quot;foo called with cooked: %s, standard: %s&quot; % \
85
...     print(&quot;foo called with cooked: %s, standard: %s&quot; %
86
...               (cooked, standard)
86
...               (cooked, standard))
87
</pre>
87
</pre>
88
</blockquote>
88
</blockquote>
89
<p>Now you can call this function with two parameters:</p>
89
<p>Now you can call this function with two parameters:</p>
90
<blockquote>
90
<blockquote>
91
<pre class="doctest-block">
91
<pre class="doctest-block">
...
...
149
<p>This same technique can be used to cook a function call graph, by making the
149
<p>This same technique can be used to cook a function call graph, by making the
150
subordinate function a cooked parameter:</p>
150
subordinate function a cooked parameter:</p>
151
<blockquote>
151
<blockquote>
152
<pre class="doctest-block">
152
<pre class="doctest-block">
153
&gt;&gt;&gt; def bar(child_fun, a):
153
&gt;&gt;&gt; def bar(child_fun, a):
154
...     print &quot;bar called with:&quot;, a
154
...     print(&quot;bar called with:&quot;, a)
155
...     return child_fun(a)
155
...     return child_fun(a)
156
</pre>
156
</pre>
157
</blockquote>
157
</blockquote>
158
<p>And now you can cook which function <tt class="docutils literal"><span class="pre">bar</span></tt> calls the same way you cook any
158
<p>And now you can cook which function <tt class="docutils literal"><span class="pre">bar</span></tt> calls the same way you cook any
159
other parameter:</p>
159
other parameter:</p>
...
...
260
    </tfoot>
260
    </tfoot>
261
  </table>
261
  </table>
262
262
263
  <div id="last-modified">
263
  <div id="last-modified">
264
    Page last modified
264
    Page last modified
265
    Mon, Oct 27 2008.
265
    Wed, Mar 25 2009.
266
266
267
  </div>
267
  </div>
268
268
269
  <script type="text/javascript">
269
  <script type="text/javascript">
270
    var gaJsHost = (("https:" == document.location.protocol) ?
270
    var gaJsHost = (("https:" == document.location.protocol) ?