[Python-ideas] Trial balloon: adding variable type declarations in support of PEP 484
Brendan Barnwell
brenbarn at brenbarn.net
Thu Aug 4 15:19:58 EDT 2016
On 2016-08-04 12:09, Alexander Belopolsky wrote:
> On Thu, Aug 4, 2016 at 2:33 PM, Brendan Barnwell
<brenbarn at brenbarn.net> wrote:
>> It seems odd to have Python syntax that not only doesn't do
anything, but
>> can't even be made to do anything by the program itself when it runs.
>
> Why do you find this odd? Python already has #-comment syntax with
> exactly the property you complain about. Think of local variable
> annotation as a structured comment syntax.
Exactly. But the existing comment annotations (# type: float) already
are structured comment syntax, so what does this new one add? (Note we
already have at least one parallel --- although it is much more limited
in scope --- namely encoding declarations, which are also done within
existing comment syntax, rather than having their own "real" syntax.)
--
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is no
path, and leave a trail."
--author unknown
More information about the Python-ideas
mailing list