| Deutsch English Français Italiano |
|
<names-20230930201603@ram.dialup.fu-berlin.de> View for Bookmarking (what is this?) Look up another Usenet article |
Path: eternal-september.org!news.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: type annotation vs working code
Date: 30 Sep 2023 19:30:41 GMT
Organization: Stefan Ram
Lines: 14
Expires: 1 Sep 2024 11:59:58 GMT
Message-ID: <names-20230930201603@ram.dialup.fu-berlin.de>
References: <ZRhwWN29i3mskxEL@hermes.hilbert.loc> <mailman.371.1696100442.23016.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de pUHE8DlRLqGRBiBdK9jtiwPPitXDrL7iHxtfr5jI9Mk4dC
Cancel-Lock: sha1:sK1X7XfdWW/S/2A3ca1sE/3KqBo= sha256:g2SKodsKJmTAGTfhX91DZ8mzbGrHzaXQzTSvtHBkHHY=
X-Copyright: (C) Copyright 2023 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en
Accept-Language: de-DE-1901, en-US, it, fr-FR
Karsten Hilbert <Karsten.Hilbert@gmx.net> writes:
>Where's the error in my thinking (or code) ?
Boiling down your code to the source file
name:bool
print( name )
, the "name:bool" specifies the type of the name, but does
not actually bind the name to a value nor does it require the
name to have a value, so one gets an error only on the second
line. Maybe this "feature" is somewhat underdocumented.