Thanks a lot Matt and Steve. I replaced __int__ with __new__ and it worked<br><br><br><div><span class="gmail_quote">On 7/23/07, <b class="gmail_sendername">Matt McCredie</b> <<a href="mailto:mccredie@gmail.com">mccredie@gmail.com
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><span class="q"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Do you guys know why the if statement is not evaluated?</blockquote></span><div><br>For immutable types __new__ is called before __init__. There are some details here: 
<a href="http://docs.python.org/ref/customization.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://docs.python.org/ref/customization.html</a>. Also, it isn't really clear what you want to do if the value is set to None anyway. In your example you return None, but that simply won't work since you can't return anything from __init__. Perhaps your need could be met by a function instead:
<br><br><code><br>def INT(x):<span class="q"><br>    if x is None:<br>        return None<br></span>    else: return int(x)<br></code><br><br>-Matt<br></div><br></div><br>
</blockquote></div><br>