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>
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