[DB-SIG] Experiences with DB-API2.0
Tom Jenkins
tjenkins@devis.com
20 Jun 2002 12:27:42 -0400
On Thu, 2002-06-20 at 12:25, Dustin Sallings wrote:
> # I figured it wasn't right of me to bitch without doing any work to fix
> # it. So when 3.0 api gets discussed, I plan on being here.
>
> Not to sound all AOLish, but this is my exact experience. I came
> to python from Java, and I've found that many of the APIs seem much less
> well designed. Honestly, I believe the python community should try to
Hrmm... interesting, i also came to python via java. i wonder if this
issue is a stickler for the folks with java background?
>
> I also believe a proper resultset object would be a huge
> improvement over list results. I saw a proposal come through here that
> looked pretty good, but it still allowed ambiguity (result rows were
> accessible via __getitem__ *or* direct attributes on the row, I think the
> latter is a bad idea because it wouldn't work in all situations).
>
well, if i need to i use dtuple
(http://www.lyra.org/greg/python/dtuple.py) which does what you want.
Sometimes i just don't need a resultset object, and the returned tuple
is just fine (not to mention faster).
this btw caused a bit of trouble, pyscopg returns tuples, but pypgsql
returns there own result object unless you set a flag. dtuple expects a
tuple (iirc) so that was another change i had to set <wink>
--
Tom Jenkins
Development InfoStructure
http://www.devis.com