Sujet : Re: type annotation vs working code
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.pythonDate : 30. Sep 2023, 20:30:41
Autres entêtes
Organisation : Stefan Ram
Message-ID : <names-20230930201603@ram.dialup.fu-berlin.de>
References : 1 2
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.