Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gH6Pz-0007UV-Rg for psycopg@arkaria.postgresql.org; Mon, 29 Oct 2018 12:13:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gH6Pw-0006Nc-T1 for psycopg@arkaria.postgresql.org; Mon, 29 Oct 2018 12:13:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gH6Pw-0006N1-Ic for psycopg@lists.postgresql.org; Mon, 29 Oct 2018 12:13:12 +0000 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gH6Pt-0000EL-Jk for psycopg@lists.postgresql.org; Mon, 29 Oct 2018 12:13:10 +0000 Received: by mail-lj1-x230.google.com with SMTP id f3-v6so7526747ljk.9 for ; Mon, 29 Oct 2018 05:13:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SnoXtO1DhDIrX6ebMNJ4a195sc4Qo+OPPEBmZQUEsao=; b=KTroID9/klyw3QvtB97/83fRmcve0xoFUEp9pKERhWpWCiln1C5Qd9/SwBYbT6JZv/ d7Pu303tZn+XbtHpco6RHHjpDU6Cvyv6kHNHjc6WDDf4Q4k3uZEi7uABVB2/OwJwu/+n y1qPKasy49E2iN0D5KkhnXbT9txgnfzqAjw3IUXDFoyN0FdqDE6yn1bE6/20IfWNupAt 8KAXK03VJvkru6aWRtEDRm02A/Hl3er6G8uqQbK/8Lq9dHnX4PGhNTNh0Zy3H2QFfV8g rDgdyHHicHXDIl2ZDBf9d4o/rWlBpQvqjKyNZjB9Zvrl/w+r2db6S9xtN9E6PhlA1ho4 UGIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SnoXtO1DhDIrX6ebMNJ4a195sc4Qo+OPPEBmZQUEsao=; b=KIZNtnfylQVANKOOZbYS9+S2U2ySoe2werwhSb+6BVltV/AIb2/qqYoOTpAW4LwlyX 9IO76E0t+id+fLg46q7gMXEwiyj8Z0bLSvN/gJULiEbWDs0SEgl1VU4+32rGwd6hX0wi BAqAqGJ7U399eEYarK+cr2/kXGXzhdrBP93S0oZrAXDa8slatgIrVCYRMZ6bLbFTvTZH hE/X50F9gi5k2eucfvCEjpVo1HDHI8JMrBwM4VNEurqctyL8frGxKXuCkxYW4N5cgsfI AYQF9dPs/tWJpP3e9zczyWWHCdl+aUdXZM+I65AizxYHYM//R/lmbtwiA8EZFmk5NJqo jdFQ== X-Gm-Message-State: AGRZ1gLXdiKVu1SVlGt/IPbxFV0WeO4gTj2SAbG5Hq9QMUqpJyhv44Hf jh9IE/8d4PKEpg9l0INhMccM5xvc1mz4Kxj4lxcl24di X-Google-Smtp-Source: AJdET5fga51pbImuCNtAT/iGPAq0wdlxbmBUO2J+KSook2MIik/1ovRwEuYxkenLZQ8548IHKzZ1KhaZxKwnlnMRy0g= X-Received: by 2002:a2e:1603:: with SMTP id w3-v6mr3058827ljd.33.1540815187262; Mon, 29 Oct 2018 05:13:07 -0700 (PDT) MIME-Version: 1.0 References: <1878453370.14916776.1539604797985@mail.yahoo.com> <62b46b76-ce7f-6b89-b5ad-d0f2c2533432@dndg.it> <1820701010.20861820.1540152265403@mail.yahoo.com> <1390677301.27162879.1540762541620@mail.yahoo.com> <20181029105422.GD2262@hermes.hilbert.loc> In-Reply-To: <20181029105422.GD2262@hermes.hilbert.loc> From: Daniele Varrazzo Date: Mon, 29 Oct 2018 12:12:56 +0000 Message-ID: Subject: Re: Feature branches merged to master for 2.8 release To: Karsten Hilbert Cc: psycopg@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Oct 29, 2018 at 10:54 AM Karsten Hilbert wrote: > Apart from a wrapper class one can always monkey-patch > > my_dbapi_instance._get_native_connection = my_dbapi_instance.get_native_connection > > at runtime. True for a Python object, but not for a C extension object. But subclassing is supported, so one would be able to do: >>> class MyConnection(psycopg2.extensions.connection): ... _get_native_connection = psycopg2.extensions.connection.get_native_connection ... >>> cnn = psycopg2.connect('', connection_factory=MyConnection) >>> ptr = cnn._get_native_connection() -- Daniele