On Mon, Jan 11, 2016 at 5:39 PM, Steven D'Aprano <steve@pearwood.info> wrote:
On Mon, Jan 11, 2016 at 12:22:55PM -0800, Andrew Barnert via Python-ideas wrote:

> in a few months we're going to see
> Dropbox and Google and everyone else demanding a way to use type
> hinting without wasting memory on annotations are runtime in 3.x.

I would be happy to see a runtime switch similar to -O that drops
annotations in 3.x, similar to how -OO drops docstrings.

Actually my experience with -OO (and even -O) suggest that that's not a great model (e.g. it can't work with libraries like PLY that inspect docstrings). A better model might be to let people select this on a per module basis. Though I could also see a future where __annotations__ is a more space-efficient data structure than dict.

Have you already run into a situation where __annotations__ takes up too much space?
 
--
--Guido van Rossum (python.org/~guido)