Dag Sverre Seljebotn, 26.11.2009 15:49: > This is the first time I hear of us having type inference at all. Did I > miss a discussion somewhere? Could someone point me to the right > changeset so that I can read up on it? (I guess this is something I > should know how works even if I don't work on it so that I don't break > it...)
The relevant commits start here IIRC: http://hg.cython.org/cython-devel/rev/64f4242db9f0 The basic idea is that assignments 'taint' their targets with the assigned type. As Robert writes, this breaks all sorts of code as it drops the feature that an assignment to an untyped variable converts the value to a Python object. It's currently unclear how to deal with this in the future. It might be nice to just enable this feature for Python types by default, so that optimisations like list.append() strike automatically for lists created inside of the function, or to make extension type attributes and functions directly available after instantiation without the need to type a variable. I think that would break the least amount of existing code, while providing the largest benefit. Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
