public inbox for [email protected]  
help / color / mirror / Atom feed
From: Federico Di Gregorio <[email protected]>
To: [email protected]
Subject: Re: Feature branches merged to master for 2.8 release
Date: Mon, 29 Oct 2018 12:47:50 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+mi_8bV4sq2HgAvMEx3ea6semu7g9pmwaW3gej4-peJHzO9Dg@mail.gmail.com>
References: <CA+mi_8aVzn-4Ujuqg5aMduHjL1XQ3Y7sUU86s3p6shMefaPoSQ@mail.gmail.com>
	<[email protected]>
	<CA+mi_8bSZw7CAFPOKyanYVu2_AbP-+gcUd8N7oD-oisgth6o6A@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CA+mi_8bV4sq2HgAvMEx3ea6semu7g9pmwaW3gej4-peJHzO9Dg@mail.gmail.com>

On 10/29/2018 11:49 AM, Daniele Varrazzo wrote:
> On Sun, Oct 28, 2018 at 9:35 PM Christian Ferrari <[email protected]> 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                         [email protected]
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




view thread (20+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Feature branches merged to master for 2.8 release
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox