Re: Change in datetime type casting - Mailing list psycopg

From Federico Di Gregorio
Subject Re: Change in datetime type casting
Date
Msg-id 4FEC748B.1020604@dndg.it
Whole thread Raw
In response to Re: Change in datetime type casting  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
List psycopg
On 28/06/12 16:43, Daniele Varrazzo wrote:
>
>> > Bigger question:) Is it possible to turn adaption off for a
>> > connection/cursor?
> No, I think adaptation is currently only global. No, I don't like this
> asymmetry with typecasting either.

This asymmetry exists because adaptation was modeled on PEP 246 and at
the time a global type registry was enough (you could always write your
own wrapper that would adapt the wrapped object, see AsIs for an example.)

Having per-connection and per-cursor adapter registries would be nice.

federico

--
Federico Di Gregorio                         federico.digregorio@dndg.it
Studio Associato Di Nunzio e Di Gregorio                  http://dndg.it
  Qu'est ce que la folie? Juste un sentiment de liberté si
   fort qu'on en oublie ce qui nous rattache au monde... -- J. de Loctra

psycopg by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Change in datetime type casting
Next
From: Никитин Константин
Date:
Subject: A very strange freeze