string literal vs string variable

2009-08-22 Thread Kee Nethery
On Aug 22, 2009, at 3:32 AM, Stefan Behnel wrote: You can use both, but I suspect parsing from StringIO to be slower than parsing from the string directly. That's the case for lxml, at least. Note that fromstring() behaves the same as XML(), but it reads better when parsing from a

Re: string literal vs string variable

2009-08-22 Thread Piet van Oostrum
Kee Nethery k...@kagi.com (KN) wrote: KN On Aug 22, 2009, at 3:32 AM, Stefan Behnel wrote: You can use both, but I suspect parsing from StringIO to be slower than parsing from the string directly. That's the case for lxml, at least. Note that fromstring() behaves the same as XML(), but

Re: string literal vs string variable

2009-08-22 Thread Jan Kaliszewski
22-08-2009 o 19:46:51 Kee Nethery k...@kagi.com wrote: I'm not sure I know the difference between a string variable and a literal string. Is the difference as simple as: somestring = u'stuffhello world/stuff' fromstring(somestring) -- string variable vs XML(u'stuffhello world/stuff') --