Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

6 May, 2024: The networking issue during the past two days has been identified and fixed.


devel / comp.lang.python / Re: learning python ...

SubjectAuthor
o Re: learning python ...Alan Gauld

1
Re: learning python ...

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: alan.ga...@yahoo.co.uk (Alan Gauld)
Newsgroups: comp.lang.python
Subject: Re: learning python ...
Date: Tue, 25 May 2021 00:36:41 +0100
Lines: 29
Message-ID: <mailman.319.1621905601.3087.python-list@python.org>
References: <143d4163-faf5-3794-095d-f28e85a18c58@adminart.net>
<s8e3bn$105v$1@ciao.gmane.io>
<6730da2c-1440-ad59-7494-b5ce5b5bccae@adminart.net>
<CACFDE8bsJe2BMNwsXAiGyxsMxNE+RuENj62GtfEzqodh5O_mMA@mail.gmail.com>
<5cec7f52-a66b-608c-4816-a3d8816658b2@adminart.net>
<CAPTjJmpOXQ0m4-=uty96t+K9VCvZ_7UWdzPOKYw-vocRFq50eQ@mail.gmail.com>
<6ad46670-a0b4-d556-3b03-284ffa451c89@adminart.net>
<d7qnaglvh89gpvn5b3km3v7hk5ukvhk81i@4ax.com> <s8gseq$829$1@ciao.gmane.io>
<s8hda9$15dk$1@ciao.gmane.io>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de /nc2H3CnIkE5F0f0klpj3AiQDfH1wEy4aORoICc0i4jQ==
Return-Path: <python-python-list@m.gmane-mx.org>
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.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '(e.g.': 0.04; 'argument':
0.04; 'traceback': 0.04; 'url-ip:65/8': 0.05; 'subject:python':
0.06; 'compiler': 0.09; 'expression': 0.09; 'message-
id:@ciao.gmane.io': 0.09; 'received:ciao.gmane.io': 0.09;
'received:gmane.io': 0.09; 'received:list': 0.09; 'conditional':
0.16; 'expressions': 0.16; 'flickr': 0.16; 'from:addr:alan.gauld':
0.16; 'from:name:alan gauld': 0.16; 'literals': 0.16; 'parsing':
0.16; 'photo-blog': 0.16; 'received:116.202': 0.16;
'received:116.202.254': 0.16; 'received:116.202.254.214': 0.16;
'syntaxerror:': 0.16; 'url-ip:79.170.44.132/32': 0.16; 'url-
ip:79.170.44/24': 0.16; 'url-ip:79.170/16': 0.16; 'url-ip:79/8':
0.16; 'url:alan-g': 0.16; 'url:alan_gauld': 0.16;
'url:alangauldphotos': 0.16; 'wrote:': 0.16; 'syntax': 0.16;
'python': 0.16; 'grant': 0.17; 'figure': 0.18; 'url:amazon': 0.20;
'to:addr:python-list': 0.23; 'error': 0.28; 'header:User-Agent:1':
0.31; 'but': 0.31; "doesn't": 0.32; '"",': 0.32; "wouldn't": 0.32;
'program': 0.33; 'header:In-Reply-To:1': 0.33; 'invalid': 0.35;
'at:': 0.37; 'errors': 0.37; 'author': 0.38; 'file': 0.38; "it's":
0.38; 'messages': 0.40; 'follow': 0.63; 'care': 0.67; 'accept':
0.68; 'site': 0.69; 'url:author': 0.69; 'received:116': 0.71;
'out.': 0.80; 'admit': 0.84
X-Injected-Via-Gmane: http://gmane.org/
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.8.1
In-Reply-To: <s8gseq$829$1@ciao.gmane.io>
Content-Language: en-GB
X-Mailman-Approved-At: Mon, 24 May 2021 21:19:59 -0400
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
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: <s8hda9$15dk$1@ciao.gmane.io>
X-Mailman-Original-References: <143d4163-faf5-3794-095d-f28e85a18c58@adminart.net>
<s8e3bn$105v$1@ciao.gmane.io>
<6730da2c-1440-ad59-7494-b5ce5b5bccae@adminart.net>
<CACFDE8bsJe2BMNwsXAiGyxsMxNE+RuENj62GtfEzqodh5O_mMA@mail.gmail.com>
<5cec7f52-a66b-608c-4816-a3d8816658b2@adminart.net>
<CAPTjJmpOXQ0m4-=uty96t+K9VCvZ_7UWdzPOKYw-vocRFq50eQ@mail.gmail.com>
<6ad46670-a0b4-d556-3b03-284ffa451c89@adminart.net>
<d7qnaglvh89gpvn5b3km3v7hk5ukvhk81i@4ax.com> <s8gseq$829$1@ciao.gmane.io>
 by: Alan Gauld - Mon, 24 May 2021 23:36 UTC

On 24/05/2021 19:48, Grant Edwards wrote:

>> Traceback ( File "<interactive input>", line 1
>> if = 1.234
>> ^
>> SyntaxError: invalid syntax
>
> I must admit it might be nice if the compiler told you _why_ the
> syntax is invalid (e.g. "expected conditional expression while parsing
> 'if' statement").

Although wouldn't it be "expected boolean expression" rather than
conditional expression? Python doesn't care how the argument to 'if'
is arrived at so long as it's a boolean. And with assignment
expressions, conditional expressions and literals all possible
unambiguous error messages get harder and harder to figure out.

But I do accept the general point that slightly more information
about syntax errors would be nice.

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor