[Python-ideas] Delay evaluation of annotations

אלעזר elazarg at gmail.com
Mon Sep 26 06:20:37 EDT 2016


Thank you all. I think this thread is pretty much close by now. I
understand at least most of your concerns and I will take time to shape my
idea.

I wanted to note one last thing, though, regarding my claim that
annotations are not actually standard expressions: Guido had once expressed
his concerns regarding the performance hit of using cast(), since it is not
easily (or at all) optimized away. This performance hit should not be there
in the first place, if the distinction between annotations and evaluatable
expressions was kept - i.e. by allowing the attachment of annotations to
expressions (as I believe was proposed several times).

Now, I understand that there are very good reasons not to allow it; keeping
the language simple and familiar would be my first guess - but note how the
semantics of the "main" language is hindered by the complexities of its
specification-related syntactic subset, which is not due, in my opinion. If
you want to specify things, the syntactic hit is unavoidable, but the
semantic hit is not.

(BTW why isn't it written cast[T](exp) ?)

Thank you again for this discussion
Elazar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160926/359c6071/attachment.html>


More information about the Python-ideas mailing list