Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Those who don't understand Linux are doomed to reinvent it, poorly. -- unidentified source


devel / comp.lang.python / Re: What to use for finding as many syntax errors as possible.

SubjectAuthor
o Re: What to use for finding as many syntax errors as possible.Peter J. Holzer

1
Re: What to use for finding as many syntax errors as possible.

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: hjp-pyt...@hjp.at (Peter J. Holzer)
Newsgroups: comp.lang.python
Subject: Re: What to use for finding as many syntax errors as possible.
Date: Sun, 9 Oct 2022 21:46:47 +0200
Lines: 60
Message-ID: <mailman.583.1665344810.20444.python-list@python.org>
References: <a95001e1-b60e-63ce-d363-30481d115282@vub.be>
<CABaFrRayYinb9Cd1w=iAz1NWmt6MOzam1yEYXPaAMjREriVUAg@mail.gmail.com>
<00893b0c-e367-6fc9-cdae-f0ee42bc16c0@vub.be>
<CABaFrRaaXAz6ZygQNpp2LTNgVMh+hv55RoBv+ZS7E8s4ki83+w@mail.gmail.com>
<20221009194647.tp7kj6nj34gpo7bf@hjp.at>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
protocol="application/pgp-signature"; boundary="2ij5ziklnybrhmfm"
X-Trace: news.uni-berlin.de YZqE5wiNJueZcannxCc7GgthRz8kv8ZMkr47GR+qr2Ow==
Return-Path: <hjp-python@hjp.at>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.003
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'content-
type:multipart/signed': 0.05; 'issue.': 0.05; 'byte': 0.09;
'compiler': 0.09; 'content-type:application/pgp-signature': 0.09;
'filename:fname piece:asc': 0.09; 'filename:fname
piece:signature': 0.09; 'filename:fname:signature.asc': 0.09;
'rarely': 0.09; 'import': 0.15; 'syntax': 0.15; '"creative': 0.16;
'__/': 0.16; 'avi': 0.16; 'challenge!"': 0.16; 'compiled': 0.16;
'effects.': 0.16; 'executables': 0.16; 'from:addr:hjp-python':
0.16; 'from:addr:hjp.at': 0.16; 'from:name:peter j. holzer': 0.16;
'gross': 0.16; 'hjp@hjp.at': 0.16; 'holzer': 0.16; 'interpreter':
0.16; 'reality.': 0.16; 'stross,': 0.16; 'subject:syntax': 0.16;
'url-ip:212.17.106.137/32': 0.16; 'url-ip:212.17.106/24': 0.16;
'url-ip:212.17/16': 0.16; 'url:hjp': 0.16; '|_|_)': 0.16;
'wrote:': 0.16; 'python': 0.16; 'to:addr:python-list': 0.20;
'issue': 0.21; 'code': 0.23; 'run': 0.23; '(and': 0.25;
'anything': 0.25; 'thorough': 0.26; 'sense': 0.28; 'error': 0.29;
'think': 0.32; 'execution': 0.32; 'language.': 0.32; 'but': 0.32;
'subject:for': 0.33; 'there': 0.33; 'header:In-Reply-To:1': 0.34;
'files': 0.36; 'errors': 0.36; 'really': 0.37; "it's": 0.37;
'this.': 0.37; 'file': 0.38; 'could': 0.38; 'place.': 0.40;
'subject:What': 0.40; 'something': 0.40; 'received:212': 0.62;
'true': 0.63; 'less': 0.65; 'received:userid': 0.66; 'generally':
0.67; 'prevent': 0.67; 'choose': 0.67; 'assembly': 0.69;
'equipped': 0.69; 'relate': 0.69; 'url-ip:212/8': 0.69;
'discover': 0.80; 'catch': 0.84; 'imports': 0.84; 'incentive':
0.84; 'interpreters': 0.84; 'received:at': 0.84; 'subject:many':
0.84; 'weird': 0.84; 'former': 0.93; 'stable': 0.93; 'immediate':
0.97
Mail-Followup-To: python-list@python.org
Content-Disposition: inline
In-Reply-To: <CABaFrRaaXAz6ZygQNpp2LTNgVMh+hv55RoBv+ZS7E8s4ki83+w@mail.gmail.com>
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: <20221009194647.tp7kj6nj34gpo7bf@hjp.at>
X-Mailman-Original-References: <a95001e1-b60e-63ce-d363-30481d115282@vub.be>
<CABaFrRayYinb9Cd1w=iAz1NWmt6MOzam1yEYXPaAMjREriVUAg@mail.gmail.com>
<00893b0c-e367-6fc9-cdae-f0ee42bc16c0@vub.be>
<CABaFrRaaXAz6ZygQNpp2LTNgVMh+hv55RoBv+ZS7E8s4ki83+w@mail.gmail.com>
 by: Peter J. Holzer - Sun, 9 Oct 2022 19:46 UTC
Attachments: signature.asc (application/pgp-signature)

On 2022-10-09 15:18:19 -0400, Avi Gross wrote:
> Antoon, it may also relate to an interpreter versus compiler issue.
>
> Something like a compiler for C does not do anything except write code in
> an assembly language. It can choose to keep going after an error and start
> looking some more from a less stable place.
>
> Interpreters for Python have to catch interrupts as they go and often run
> code in small batches. Continuing to evaluate after an error could cause
> weird effects.

I don't think this is really an issue. A python file is completely
compiled to byte code before execution starts.

It's true that a syntax error before an import prevents that import, but
since imports are usually at the start of a file, a syntax error will
only rarely prevent the import (and files intended to be imported
generally don't have weird side effects anyway).

One issue is could be that compilers which generate executables are
generally thorough and slow, while the compilers which generate
byte-code for immediate consumption by an interpreter are generally
simple and fast. So there is more incentive for the former to discover
as many errors as possible and they are also better equipped to do this.

hp

--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp@hjp.at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"

Attachments: signature.asc (application/pgp-signature)
1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor