Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"If it's not loud, it doesn't work!" -- Blank Reg, from "Max Headroom"


devel / comp.lang.python / Re: is mypy failing here

SubjectAuthor
o Re: is mypy failing hereKirill Ratkin

1
Re: is mypy failing here

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: niktarli...@zohomail.com (Kirill Ratkin)
Newsgroups: comp.lang.python
Subject: Re: is mypy failing here
Date: Thu, 24 Nov 2022 16:50:04 +0300
Lines: 35
Message-ID: <mailman.1043.1669311226.20444.python-list@python.org>
References: <dcc14cc5-b541-4bf9-97c7-1645d0bd8401@everest.reportlab.co.uk>
<Y392jOw36Zs+zCtU@build>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
X-Trace: news.uni-berlin.de rFcsJj4JAxaZv+4Bo6ngVA6LPVK7b5damhz3RmYxFqVw==
Return-Path: <niktarlirik@zohomail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="1024-bit key; unprotected key"
header.d=zohomail.com header.i=niktarlirik@zohomail.com
header.b=erqkSNhh; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.001
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'def': 0.04; '2022': 0.05;
'indicate': 0.05; 'much,': 0.09; 'skip:# 30': 0.09; 'import':
0.15; 'url:mailman': 0.15; 'becker': 0.16; 'case?': 0.16; 'cat':
0.16; 'main()': 0.16; 'received:136.143': 0.16;
'received:136.143.188': 0.16; 'received:zoho.com': 0.16; 'robin':
0.16; 'subject:failing': 0.16; 'subject:here': 0.16; 'typing':
0.16; 'wrote:': 0.16; 'python': 0.16; 'thu,': 0.19; 'to:addr
:python-list': 0.20; 'url-ip:188.166.95.178/32': 0.25; 'url-
ip:188.166.95/24': 0.25; 'url:listinfo': 0.25; 'url-
ip:188.166/16': 0.25; 'error': 0.29; 'url-ip:188/8': 0.31;
'received:136': 0.32; 'but': 0.32; "didn't": 0.34; 'header:In-
Reply-To:1': 0.34; 'source': 0.36; 'class': 0.37; 'file': 0.38;
'should': 0.40; 'detail': 0.61; 'gives': 0.62; 'received:82':
0.62; 'playing': 0.69; 'supposed': 0.76; 'success:': 0.84
ARC-Seal: i=1; a=rsa-sha256; t=1669297810; cv=none;
d=zohomail.com; s=zohoarc;
b=gZnQjGRDoCSgfKgHvv3LYr1lAjh0Hx/XJ2w0YUciPO9YoqIpYCNOxjc6DsPZBMRquYcMHQKeqdW1HmriwoKVg7vqPFhwghxhNcmduYfvjo/8qGKPpfJx9vIJ1HNTMFxwyWdS8x9nCNllrFGQX+kD1cjDUONzJ+ok26EqDdGJ2lo=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
s=zohoarc; t=1669297810;
h=Content-Type:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To;
bh=ZYnZ3K2JDM6gwMSBq71sYJ42ie4o8mCQbnmCyEJxRW0=;
b=kHbIe8nNxtP55NuHP4O1ZILtWmfZL4GmoebFXjfQKuIXCY8y1M9NF/xjGCT6c/L3nzrHnXx4eNLqoQF/ySRXjhZ618+n4F+z0diUiMxzhx/tMVdr9c9HN2OEDtfaf9l6FvbV6iLTl7DoGBieJM2TEHoyJD1xu7MizwfzRKTAxgA=
ARC-Authentication-Results: i=1; mx.zohomail.com;
dkim=pass header.i=zohomail.com;
spf=pass smtp.mailfrom=niktarlirik@zohomail.com;
dmarc=pass header.from=<niktarlirik@zohomail.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1669297810;
s=zm2022; d=zohomail.com; i=niktarlirik@zohomail.com;
h=Date:Date:From:From:To:To:Subject:Subject:Message-ID:References:MIME-Version:Content-Type:In-Reply-To:Message-Id:Reply-To:Cc;
bh=ZYnZ3K2JDM6gwMSBq71sYJ42ie4o8mCQbnmCyEJxRW0=;
b=erqkSNhhAOO7g0Vpbkt00KU/PihT4FJP+AY+NZu2x4aZ8vDeivXyCEM3xuv1MREh
+FkYu8ib8HpDptGlGSKX85Coz8FWabj8H/pwBwsPsPQ6053c1gx2tTM9PL+sMTefkZQ
KYvf8eS2Z4z9klBa3sB+PTMlk70GfdhXzZDNe4+s=
Content-Disposition: inline
In-Reply-To: <dcc14cc5-b541-4bf9-97c7-1645d0bd8401@everest.reportlab.co.uk>
X-ZohoMailClient: External
X-Mailman-Approved-At: Thu, 24 Nov 2022 12:33:45 -0500
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: <Y392jOw36Zs+zCtU@build>
X-Mailman-Original-References: <dcc14cc5-b541-4bf9-97c7-1645d0bd8401@everest.reportlab.co.uk>
 by: Kirill Ratkin - Thu, 24 Nov 2022 13:50 UTC

Hi Robin,

mypy --strict gives you detail info.

On Thu, Nov 24, 2022 at 10:05 +0000, Robin Becker wrote:
> I haven't used dataclasses or typing very much, but while playing about I found this didn't give me an expected error
>
> (.py312) robin@minikat:~/devel/reportlab
> $ cat tmp/examples/tdc.py && python tmp/examples/tdc.py && mypy tmp/examples/tdc.py
> ##################################
> from dataclasses import dataclass
>
> @dataclass
> class DC:
> a: str
> b: str
>
> def main():
> dc = DC(DC, "B")
> print(dc)
>
> if __name__ == "__main__":
> main()
> ##################################
> DC(a=<class '__main__.DC'>, b='B')
> Success: no issues found in 1 source file
> (.py312) robin@minikat:~/devel/reportlab
>
> DC.a is supposed to be a str and I expected mypy to indicate a type error
>
> should typing work for this case?
> --
> Robin Becker
> --
> https://mail.python.org/mailman/listinfo/python-list

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor