<br><br> <br><br><div class="gmail_quote">On Fri, Jan 16, 2009 at 14:56, greg whittier <span dir="ltr">&lt;<a href="mailto:greg@thewhittiers.com">greg@thewhittiers.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
In python, the name of a function is just a pointer to it. &nbsp;Try this<br>
<br>
&gt;&gt;&gt; def foo():<br>
 &nbsp; &nbsp; &nbsp; &nbsp;print &quot;Hi!&quot;<br>
<br>
<br>
&gt;&gt;&gt; class Problem:<br>
 &nbsp; &nbsp; &nbsp; &nbsp;def __init__(self,fun):<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;self.fun = fun<br>
<br>
<br>
&gt;&gt;&gt; p1 = Problem(foo)<br>
&gt;&gt;&gt; p2 = Problem(foo)<br>
&gt;&gt;&gt; foo<br>
&lt;function foo at 0x012C52B0&gt;<br>
&gt;&gt;&gt; p1.fun<br>
&lt;function foo at 0x012C52B0&gt;<br>
&gt;&gt;&gt; p2.fun<br>
&lt;function foo at 0x012C52B0&gt;<br>
&gt;&gt;&gt; p1.fun == p2.fun<br>
True<br>
&gt;&gt;&gt;<br></blockquote><div><br><br>Wow!!! &nbsp; I thought that the question was simple but I was afraid that the answer was going to be too complex.<br><br>But I see that it actually works like I thought it should!!! It&#39;s extremely simple and intuitive, IMHO.<br>
<br>Thank you to all for your precise and clear answers. I&#39;ve learned a lot, and specially appreciate the links that Kent provided.<br></div></div><br>I hope I can contribute to this forum in the future.<br><br clear="all">
<br>-- <br>Vicent<br>