"John Machin" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> I suppose it all depends on your definition of obvious :-)
I was looking for a constructor that was the complement of str(). Most/many 
languages would provide that. Sometimes it's called parse().

> The constructor is datetime.datetime(year, ....., second) so the
> following (which works all the way back to Python 2.3) seems not too
> obscure to me:

But unobvious in a different way :). Thanks, I'll use that.

> If you have, as you should, Python 2.5, you can use this:

I would like to do that, but the tools I need are not released in 2.5 yet. 
RSN!

> How do you push a str or float object back into an SQL column of
> appropriate type? What's the difference? Your DB API should handle this
> quite transparently. Try it and see what happens.

Most values tend to work, but only because the SQL string representation 
happens to be the same as the Python representation. That may not apply to 
some float values, bool, perhaps others. I had hoped the tools would have 
solved those problems so I don't have to. In typed languages (Java, C#) 
those things tend to just work.

DY




-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to