<div dir="ltr">On Mon, Sep 22, 2008 at 6:50 PM, Dino Viehland <span dir="ltr">&lt;<a href="mailto:dinov@microsoft.com">dinov@microsoft.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">









<div link="blue" vlink="purple" lang="EN-US">

<div>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">FYI this is the same as bug #18345 - <a href="http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=18345" target="_blank">http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=18345</a></span></p>


<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"></span></p></div></div></blockquote><div>ok. I&#39;ll go over active tickets so I have a better picture of what to expect<br>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"></span></p><span style="font-size: 11pt; color: rgb(31, 73, 125);"></span><span style="font-size: 11pt; color: rgb(31, 73, 125);"> <br></span></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-US"><div>

<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">We'll fix this for the RC.</span></p></div></div></blockquote><div>great.<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-US"><div><p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</span></p>

<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">

<p><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;"> <a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a>
[mailto:<a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a>] <b>On Behalf Of </b>Ronnie Maor<br>
<b>Sent:</b> Monday, September 22, 2008 6:39 AM<br>
<b>To:</b> Discussion of IronPython<br>
<b>Subject:</b> Re: [IronPython] IP2b5 - error in calling bound method from C#?</span></p>

</div><div><div></div><div class="Wj3C7c">

<p>&nbsp;</p>

<div>

<p style="margin-bottom: 12pt;">2nd attempt at defining the
problem:<br>
&quot;problem assigning bound method to delegate?&quot;<br>
that&#39;s my last try. now someone who actually has a clue needs to look at it :-)</p>

<div>

<p>On Mon, Sep 22, 2008 at 3:29 PM, Ronnie Maor &lt;<a href="mailto:ronnie.maor@gmail.com" target="_blank">ronnie.maor@gmail.com</a>&gt; wrote:</p>

<div>

<p style="margin-bottom: 12pt;">I think this is a bug and not
some silly mistake on my part...<br>
not sure exactly which flows this effects, but here is a small repro:<br>
<br>
import System.Threading<br>
<br>
def cb(state):<br>
&nbsp;&nbsp;&nbsp; print &quot;CB CALLED&quot;<br>
<br>
class Timer(object):<br>
&nbsp;&nbsp;&nbsp; def
__init__(self,delay,interval):&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def _inner_cb(state):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print
&quot;INNER CALLED&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
self._callback(None)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f = self._callback # this is the
problematic variant<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #f = cb<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #f = _inner_cb<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.timer =
System.Threading.Timer(f,None,delay,interval)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; def _callback(self,state): # state parameter is required as
part of TimerCallback signature. ignore it.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;CALLBACK CALLED&quot;<br>
<br>
t = Timer(1000,0)<br>
print &quot;Sleeping...&quot;<br>
System.Threading.Thread.CurrentThread.Join(2000)<br>
print &quot;Woke up&quot;<br>
<br>
------------------ (end code)<br>
<br>
C:\IronPython\2.0\IronPython-2.0B5&gt;ipy \data\trunk\src\Itst.Backend\tmp.py<br>
Traceback (most recent call last):<br>
&nbsp; File &quot;\data\trunk\src\Itst.Backend\tmp.py&quot;, line 20, in
\data\trunk\src\Itst.Backend\tmp.py<br>
&nbsp; File &quot;\data\trunk\src\Itst.Backend\tmp.py&quot;, line 15, in
__init__<br>
TypeError: Value cannot be null.<br>
Parameter name: context<br>
<br>
The code works when you change f to one of the other variants (cb or
_inner_cb).<br>
For now I&#39;m going to use _inner_cb variant as a workaround so I can continue
porting my code and map other issues.<br>
<br>
one note if/when comparing with IPy 1.1. The overload resolution was not as
good there, so you need to change the call to Timer to:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Timer_ctor = System.Threading.Timer.__new__.Overloads[(System.Threading.TimerCallback,object,int,int)]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.timer =
Timer_ctor(System.Threading.Timer,f,None,delay,interval)</p>

</div>

</div>

<p>&nbsp;</p>

</div>

</div></div></div>

</div>


<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br></blockquote></div><br></div>