[Cython] CEP 507/513

Dag Sverre Seljebotn dagss at student.matnat.uio.no
Sun Apr 13 16:12:52 CEST 2008


> (On the subject of optimizations, one could also augment the CEP by 
> having the notation "exactly(MyClass)" mean "early-bind all calls and I 
> don't care about the consequences". Using "exactly(list)" would then 
> mean that builtins wouldn't need to be a special-case either. But I'm 
> fine with "list" being a special-case here.)
>   

A digression:

While

cdef exactly(MyClass) x = MyClass()
x.foo() # compile-time bound

isn't something that would be that much used by human developers, having 
it as a language feature could make some optimizations from type 
inference conceptually simpler, so that

x = MyClass()
x.foo()

would be compile-time bound. Still, dict overrides makes knowing when it 
is safe to do so non-trivial. Like I said, a digression.



-- 
Dag Sverre



More information about the Cython-dev mailing list