On Sun, Oct 28, 2018 at 9:35 PM Christian Ferrari <cam...@yahoo.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. 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. -- Daniele