[DB-SIG] format vs pyformat

Chris Cogdon chris@cogdon.org
Mon, 19 Aug 2002 15:21:37 -0700


On Monday 19 August 2002 14:33, Keating, Tim wrote:

> For that matter (is it vain to reply to yourself?), I'm pretty sure you
> could just implement __getattr__() for the criteria class type in the
> example below, then pass the critera class instance as the formatting
> argument. That solves your issue with "dictionary entries" being
> pre-calculated.

Unless the values I want to pass need to be calculated :)

A private conversation with Anthony Tuininga has raised this important is=
sue,=20
though:

As the number of parameters increase, it becomes increasingly  diffcult t=
o=20
keep accurate track of which positional parameter is being inserted into=20
which part of the query string. Anthony's term was 'doing a mental zip()'=
=2E

I've had no problem with this to date (perhaps I have a large buffer in t=
he=20
wetware ;) but I can certainly see how it would /become/ a problem at som=
e=20
point.

Hmm... perhaps there's no easy, neat solution to this problem, and what w=
e=20
have IS what's optimal.


--=20
   ("`-/")_.-'"``-._        Chris Cogdon <chris@cogdon.org>
    . . `; -._    )-;-,_`)
   (v_,)'  _  )`-.\  ``-'
  _.- _..-_/ / ((.'
((,.-'   ((,/   fL