<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><head><style>p {margin:0px;padding:0px;} blockquote { border: 0px; margin-top: 0px; margin-bottom: 0px; }</style></head><body style="">
<font color="#000000" face="Verdana" size="2"><p>Hi,</p></font><p> </p><p>I suggest adding __float__, __int__ etc. methods </p><p>to lxml.objectify StringElement, to enable things like</p><p> </p><p>>>> float(objectify.DataElement("234"))<br>Traceback (most recent call last):<br> File "<stdin>", line 1, in ?<br>TypeError: float() argument must be a string or a number<br>>>> <br></p><p> </p><p>These will just try to invoke the very same operation on the</p><p>underlying pyval. </p><p>Maybe there are other classes where such methods would</p><p>be helpful (BoolElement comes to mind, but I'll have to look).</p><p> </p><p>Any objections? I can add this plus some tests otherwise.</p><p> </p><p>Holger </p><p></p><font></font><p></p><div class="signature"><br /><br /><br />-- <br />Psssst! Schon vom neuen GMX MultiMessenger gehört?<br />Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger</div></body></html>