Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

All constants are variables.


devel / comp.lang.python / Re: mypy question

SubjectAuthor
o Re: mypy questionKarsten Hilbert

1
Re: mypy question

<mailman.68.1703853227.2892.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=29129&group=comp.lang.python#29129

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: Karsten.Hilbert@gmx.net (Karsten Hilbert)
Newsgroups: comp.lang.python
Subject: Re: mypy question
Date: Fri, 29 Dec 2023 13:33:45 +0100
Lines: 38
Sender: <karsten.hilbert@gmx.net>
Message-ID: <mailman.68.1703853227.2892.python-list@python.org>
References: <ZY64YbzKqfGbZcpC@hermes.hilbert.loc>
<ZY68qdmIszQaWpto@hermes.hilbert.loc>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de uHLmRkHmnALRCLb8yDdjoA2Mwt3lq6Qhjo+6yUqtAq8Q==
Cancel-Lock: sha1:vmFqDqzA5CEVyUqUIOGud/RZRTo= sha256:WvL2TJaa8ubs/bjWv0QjCvxpPQFgbiSuq5bd2xtqnnU=
Return-Path: <karsten.hilbert@gmx.net>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmx.net header.i=karsten.hilbert@gmx.net
header.b=D9rLHb4o; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'argument': 0.04; 'error:':
0.05; '2023': 0.07; 'matches': 0.07; 'received:212.227': 0.07;
'gpg': 0.09; 'karsten': 0.09; 'schrieb': 0.09; 'thinks': 0.09;
'1713': 0.16; 'dict': 0.16; 'dicts': 0.16; 'hilbert': 0.16;
'incompatible': 0.16; 'intent': 0.16; 'received:212.227.15': 0.16;
'python': 0.16; 'subject:question': 0.17; 'values': 0.17; 'to:addr
:python-list': 0.20; 'fri,': 0.22; "i'd": 0.24; 'anything': 0.25;
'skip:- 10': 0.25; 'dec': 0.31; 'header:In-Reply-To:1': 0.34;
'list': 0.39; 'should': 0.40; 'received:212': 0.62; 'skip:r 20':
0.64; 'queries': 0.81
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
s=s31663417; t=1703853226; x=1704458026; i=karsten.hilbert@gmx.net;
bh=A6XYOyRWaUcqYLhBJ42AN8J9J4NgOxIQfMqXCkry/No=;
h=X-UI-Sender-Class:Date:From:To:Subject:References:In-Reply-To;
b=D9rLHb4oiSW3zbe0Icw9R7dhN1IeG7sk2vV3GABdLyQuLJur2E7sEcywEluJC6ka
JwhTCBxUKZOGCDWwoocZy11I2ztBZBbOvrzNjfrLAfzR97Cy1VmyddtMuDEwikWTY
2xANOU1MIfBXtDvgBcDW7jhBbO5dElzBCd0ZrdLWTO6KdV32MoUBtc4NbQFNNz/xI
u75rf8szO3u3o5LGEUCRIx8rbqUkS44JQD6VH9Y9CEHwwBjh8umtlSuaC8qRuOVPD
0Cg4XlDCg95AoHuaxuOELl2mILO6ip5vQXC0VWqJUnMEfPZkNaIadj8xP5m3gvu79
jzfPgmtG+ECvK/B8NA==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Content-Disposition: inline
In-Reply-To: <ZY64YbzKqfGbZcpC@hermes.hilbert.loc>
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)
X-Provags-ID: V03:K1:n1AVp6LCz2jURTkgsaSL5DtHzZSvRPcQVYII40Kp33IME1R8gSn
gnI396tLbTiWS8+SpoynXr8kh9jO4KkSm4EJO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UMMulzWpY1
Wn+3to6mqoZpQBDQEF89Bhy8LwX8yPTV9zgSHctPfyo0JhyVXKHFPTtUbutAmfhvenTwpmlVi
efBv0A==
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <ZY68qdmIszQaWpto@hermes.hilbert.loc>
X-Mailman-Original-References: <ZY64YbzKqfGbZcpC@hermes.hilbert.loc>
 by: Karsten Hilbert - Fri, 29 Dec 2023 12:33 UTC

Am Fri, Dec 29, 2023 at 01:15:29PM +0100 schrieb Karsten Hilbert via Python-list:

> I am not sure why mypy thinks this
>
> gmPG2.py:554: error: Argument "queries" to "run_rw_queries" has incompatible type "List[Dict[str, str]]"; expected
> "List[Dict[str, Union[str, List[Any], Dict[str, Any]]]]" [arg-type]
> rows, idx = run_rw_queries(link_obj = conn, queries = queries, return_data = True)
> ^~~~~~~
>
> should be flagged. The intent is for "queries" to be
>
> a list
> of dicts
> with keys of str
> and values of
> str OR
> list of anything OR
> dict with
> keys of str
> and values of anything
>
> I'd have thunk list[dict[str,str]] matches that ?
>
> This is on Python 3.11.2 with mypy 1.0.1 on Debian.

For completeness, this was the mypy call signature:

mypy --pretty --allow-redefinition --no-strict-optional --ignore-missing-imports --follow-imports silent --show-error-codes --warn-unused-ignores gmPG2.py

Karsten
--
GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B


devel / comp.lang.python / Re: mypy question

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor