<div class="gmail_quote">On 15 July 2011 17:26, D'Arcy J.M. Cain <span dir="ltr"><<a href="mailto:darcy@pygresql.org">darcy@pygresql.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Fri, 15 Jul 2011 17:02:43 +0100<br>
Maxim Yegorushkin <<a href="mailto:maxim.yegorushkin@gmail.com">maxim.yegorushkin@gmail.com</a>> wrote:<br>
> However, it misses support for datetime.date objects and can't correctly<br>
> quote floats with nan value. So, I thought you may like to consider adding<br>
> the following to pgdb.py:<br>
<br>
</div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Looks reasonable. Can you work up the unit tests as well? See the<br>
script TEST_PyGreSQL_dbapi20.py. I did check and your changes don't<br>
break the existing tests but we always like to add new tests along with<br>
new code.</blockquote><div><br></div><div>Oh, I am a fan of unit tests myself. The original patch was made in anger, here is a more thoughtful one.</div><div><br></div><div>This patch extends float handling by supporting nan and inf values along with a new unit test. It basically always quotes floats to avoid isinf() and isnan() checks for each and every float value.</div>
<div><br></div><div>With regards to date support, I am thinking of handling date and datetime similar to decimal, that is, to convert strings to date and datetime when reading rowsets, so that user code does not have to convert strings to dates. Does it make sense?</div>
<div><br></div><div>-- Maxim</div><div><br></div><div><br></div><div></div></div><div><br></div>