Thanks for the valuable suggestions, Peter. I've just checked in your patch and test for caching the type casters.
One thing that needs attention here is that your patch uses nested scopes, so it may break in Py 2.1. We may need to add from __future__ import nested_scopes. Currently I'm not able to test with Py < 2.3 anyway, so I'm not sure. Maybe we should just require Py 2.3, and modify our code base a little bit? E.g. I'd suggest to use sets instead of lists as the internal values of the pgdbType. > This is against the 2.8.2 beta tarball. Am I being thick or is the CVS > repository not usefully available for checkouts? I just find the web > interface. D'Arcy must answer/fix that. > First of all, in testing my changes I discovered another bug which is > that for bool columns, we no longer receive a True/False from > pgdb. This is because 'bool' was added as mapping to the STRING > pgdbType(). You're right, that's a bug that was accidentally introduced when separating the mandatory from the optional types. > Was this done intentionally to make sure that all pg types map to some > form of standard DB API type? Yes, I think that was the reasoning. > If so, the correct fix, as I see it, is to retain the 'bool' mapping > for both STRING and BOOL, but to make sure type casting prefers > treating it as a BOOL above treating it as a STRING (to test for BOOL > first). Fixed it that way now. This is now also tested in TEST_PyGreSQL_dbapi20.py. Unfortunately, it was not discovered by the test before, because BOOL is only an optional extension. -- Christoph _______________________________________________ PyGreSQL mailing list [email protected] http://mailman.vex.net/mailman/listinfo/pygresql
