Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kLw9j-00030g-Mx for psycopg@arkaria.postgresql.org; Fri, 25 Sep 2020 22:25:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kLw9i-00052C-LQ for psycopg@arkaria.postgresql.org; Fri, 25 Sep 2020 22:25:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kLw9i-00051W-EW for psycopg@lists.postgresql.org; Fri, 25 Sep 2020 22:25:30 +0000 Received: from mout.gmx.net ([212.227.15.19]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kLw9f-0006kw-G2 for psycopg@lists.postgresql.org; Fri, 25 Sep 2020 22:25:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1601072725; bh=ISbAXiEIgozgHF8jrmo1qcTt8TJEpQWefLm4eWvnteU=; h=X-UI-Sender-Class:Date:From:To:Subject:References:In-Reply-To; b=krkuRQfc6sZjUfbGJuDawSx9yrzydcXRyl6suBkIPrtM8QH99DZ3IhlzbkDAh1H8s zW0wuSNCRB/5yhB6wjzAZlmrWbba6KRptwU1tzlYWexRLbrVHvx+RQWI+3NYpTO7h8 MR2vAsxacgwsgJUlmiH9sCSBGiKqI2OUf6nlhTfM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from hermes ([84.144.216.170]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MeCtZ-1kttOV3K9X-00bNRg for ; Sat, 26 Sep 2020 00:25:24 +0200 Received: from ncq by hermes with local (Exim 4.94) (envelope-from ) id 1kLw9b-0001zG-Uk for psycopg@lists.postgresql.org; Sat, 26 Sep 2020 00:25:24 +0200 Date: Sat, 26 Sep 2020 00:25:23 +0200 From: Karsten Hilbert To: psycopg@lists.postgresql.org Subject: Re: iterating over DictRow Message-ID: <20200925222523.GB1544@hermes.hilbert.loc> References: <20200923215444.GA25406@hermes.hilbert.loc> <20200924211147.GA2089@hermes.hilbert.loc> <9f9f7536-9d5f-d95b-b1eb-eed7ec1b83f6@aklaver.com> <20200925074820.GC2138@hermes.hilbert.loc> <4975719e-8981-c2ff-1408-c348730b31c5@aklaver.com> <20200925211635.GA1544@hermes.hilbert.loc> <65a4f678-4c7f-d88b-3709-e0686a561461@aklaver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <65a4f678-4c7f-d88b-3709-e0686a561461@aklaver.com> Ma_X_il-Followup-to: d Re_X_turn-receipt-to: Karsten.Hilbert@gmx.net Di_X_sposition-Notification-To: Karsten.Hilbert@gmx.net X-Confi_X_rm-Reading-To: Karsten.Hilbert@gmx.net X-Pri_X_ority: 2 (High) Sender: X-Provags-ID: V03:K1:vo+nvqSWsVYFw2CT1uOYO871y9H37Hxcq3I3+u1l1o5hxE1Qjmb 8CLWEX6MXNJPNYsEncA9yqpEB6d/olS4i5aBFtqVxDhi/g+FwyZ866a4BCwTkVgB8lMI7ZM xOgxFFvqLHN4E6rLwI3A71jhCgPdwHX3E0JTyhy2W8PyX0AUNLRm8G9IN9v6lRzMtVriKVM XcWkRbjzX8Qn2i4+ZzRPg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:bE0WCoqebdg=:5AalPhFPe6748T77ZKeQMP 0KJ8TG29OM72cm95HjYZmFvdt8Nq7bzwiioy/A38y+idenRtUTcl/iEQythbYXmMxpdgIGHdh 4doqsPQBw58rO9oANA7n38YyWjz6eOWDX5tOXga2FtTsqRjY7DsDHBX/TJ/z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ZkT6yMwyudeVxnLlgumjWngiJ o1EO/L2ot63f8wQ9CHKJezAm1t0oo1n3DpTfC5w== Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Sep 25, 2020 at 03:19:12PM -0700, Adrian Klaver wrote: > > Sure, there's a number of solutions to my immediate problem, > > the fitting of which is > > > > for key in dict(DictRow): > > > > That's the best fit because my > > > > def _escape_dict(the_dict, ...): > > > > was inaptly named. It should have been (and now is) > > > > def _escape_dict_like(dict_like, ...): > > > > within which > > > > dict(dict_like) > > > > is quite the thing to do despite having to make something a > > duck which already nearly quacks like one is somehwat > > unfortunate. > > I'm pretty sure DictRow has had the same behavior for some time so: > > Are you migrating from Python 2? I did not too long ago. > Or what changed that made this show up? At the very core ? My grandpa was admitted to a hospital :-) Karsten =2D- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B