A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2016-August/146032.html below:

[Python-Dev] PEP 526 ready for review: Syntax for Variable and Attribute Annotations

[Python-Dev] PEP 526 ready for review: Syntax for Variable and Attribute Annotations [Python-Dev] PEP 526 ready for review: Syntax for Variable and Attribute AnnotationsIvan Levkivskyi levkivskyi at gmail.com
Wed Aug 31 08:52:38 EDT 2016
On 31 August 2016 at 13:09, Nick Coghlan <ncoghlan at gmail.com> wrote:

> I guess as long as they're included somewhere in the AST for the
> function body, I don't mind if the translation to bytecode throws them
> away - that's essentially saying that a function level type annotation
> is effectively interpreted as if it was:
>
>     if False:
>         __annotations__[<varname>] = <annotation>
>
> So the code generator will pick up syntax errors during normal
> execution, but not runtime errors (since the expression never actually
> gets evaluated).
>

Nick, you are right, in current implementation they are included in AST
in exactly the same way as in classes and modules, but compiler throws them
away.

--
Ivan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20160831/65522754/attachment.html>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4