Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Lawrence =?iso-8859-13?q?D=FFOliveiro?= Newsgroups: comp.sys.mac.system,alt.os.linux,alt.comp.os.windows-11,comp.lang.python Subject: Re: PSA: A python script to clone your phone exactly, over Wi-Fi or USB Date: Thu, 20 Aug 2026 22:57:43 -0000 (UTC) Organization: A noiseless patient Spider Lines: 19 Message-ID: <11680p6$3s8jk$1@dont-email.me> References: <116673g$ptq$1@nnrp.usenet.blueworldhosting.com> <1166bch$39qqm$2@dont-email.me> <1167a7q$l51$1@nnrp.usenet.blueworldhosting.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 20 Aug 2026 22:57:43 +0000 (UTC) Injection-Info: dont-email.me; logging-data="4072052"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+3ye0/hyboEHTMzaqP3Cd0"; posting-host="d46d153320d65deb2c289b81dac51f44" User-Agent: Pan/0.165 (Kostiantynivka) Cancel-Lock: sha1:TnDOzDX1jOtu12hNoooJExVtars= sha256:rp+rG60JWgXXSQThaTRDkjVeS1yIz035ZcyIlEkOWoc= sha1:ogfscPPItlLzwlGHRNyPaPezi04= sha256:F/kxfxcvaadxyw+8I3LOJmvoYEInsSpKZfRSl/2+T0U= Xref: csiph.com comp.sys.mac.system:146458 alt.os.linux:83090 alt.comp.os.windows-11:33864 comp.lang.python:197889 On Thu, 20 Aug 2026 08:32:58 -0800, Maria Sophia wrote: > If I were to adapt your db_iter concept while keeping parameterized > queries safe, I'd probably modify it to accept a parameters tuple > like this: > > Python > def db_iter(conn, cmd, params=(), mapfn=lambda x: x): > """Executes cmd with parameters and yields mapped results.""" > for item in conn.cursor().execute(cmd, params): > yield mapfn(item) Yes, fair enough. I prefer to use APSW rather than the SQLite binding in the standard library; that seems nicer in some ways, providing more flexibility in placeholders for parameter substitution . I tend to fall out of the habit of using placeholder mechanisms, because they don’t cope with more advanced cases.