[lxml-dev] [lxml] adding __float__, __int__ etc. to objectify.StringElement
Holger Joukl
jholg at gmx.de
Fri Apr 4 12:58:25 CEST 2008
Hi,
I suggest adding __float__, __int__ etc. methods
to lxml.objectify StringElement, to enable things like
>>> float(objectify.DataElement("234"))
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: float() argument must be a string or a number
>>>
These will just try to invoke the very same operation on the
underlying pyval.
Maybe there are other classes where such methods would
be helpful (BoolElement comes to mind, but I'll have to look).
Any objections? I can add this plus some tests otherwise.
Holger
--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codespeak.net/pipermail/lxml-dev/attachments/20080404/1adc604a/attachment.htm
More information about the lxml-dev
mailing list