Re: Feature branches merged to master for 2.8 release

From: Federico Di Gregorio <fog(at)dndg(dot)it>
To: psycopg(at)lists(dot)postgresql(dot)org
Subject: Re: Feature branches merged to master for 2.8 release
Date: 2018-10-29 11:47:50
Message-ID: d8ae3ea6-1fc2-36aa-e32f-62c0f6109254@dndg.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

On 10/29/2018 11:49 AM, Daniele Varrazzo wrote:
> On Sun, Oct 28, 2018 at 9:35 PM Christian Ferrari <camauz(at)yahoo(dot)com> wrote:
>>
>> Dear All,
>> today I have released LIXA 1.7.1 with Python/Psycopg2 support.
>> To avoid two different methods (get_native_connection() for PostgreSQL and _get_native_connection() for MySQL/MariaDB) I have created a fork of Psycopg2 https://github.com/tiian/psycopg2/tree/get-native-connection with the code provided by Federico and method "get_native_connection" renamed.
>> For the sake of convenience I have created a pull request: https://github.com/psycopg/psycopg2/pull/798 feel free to integrate it or to go on with the process you figured out in the past.
>> Kind Regards
>> Ch.F.
>
> I don't know what Federico had decided but I'd very much prefer the
> name without underscore. Methods with underscore don't belong to an
> object interface.

Sorry for the late response, I was KO'ed by the flu. I agree with
Daniele here but the fact that the *content* of the capsule, i.e., the
PGconn* can change depending of the libpq version you're loading is
pretty scary. I'd like to warn the client code (Python warnings to be
suppressed? mm..) but just prepending an underscore to the method name
doesn't mean much. If we add `get_native_connection()` then it becomes
an official and supported psycopg extensions and doesn't make sense to
mark it as private API.

> There are always differences, in interfaces and in behaviour, between
> dbapi drivers. A private method, returning two objects which are
> different because they are very simply two database drivers, are not
> the place where to start trying to unify interfaces. What you do, if
> you want to deal with both drivers, is to write a wrapper unifying the
> interfaces. I would be ok to adapt other drivers choices, if I agreed
> with them, but I can't agree with an underscore method being
> documented as part of the API: that's internal stuff and totally not
> idiomatic Python.
>
> My vote goes to have this method name without underscore, but I'll
> leave the final decision to Federico.

Then without it is.

federico

--
Federico Di Gregorio federico(dot)digregorio(at)dndg(dot)it
DNDG srl http://dndg.it
Credo fermamente che da qualche parte, in una scatola ci sia un gatto
che non è vivo ne morto. Credo anche che se i fisici non si sbrigano
a dargli una scatoletta, ben presto sarà solo morto.
-- adattato da una frase di Sam Black Crow

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Federico Di Gregorio 2018-10-29 11:48:10 Re: Feature branches merged to master for 2.8 release
Previous Message Karsten Hilbert 2018-10-29 10:54:22 Re: Feature branches merged to master for 2.8 release