Neil Ludban, 12.01.2010 16:11: > On Jan 12, 2010, at 9:44 AM, Stefan Behnel wrote: >> Sturla Molden, 12.01.2010 14:04: >>> I'd like to make a different suggestion. What about a keyword to pass >>> after cdef in the declaration of the object to indicate the vtab can >>> be skipped? I e an assertion that the object will be of the declared >>> type. This will maintain better compatibility with Python. >>> >>> cdef Foo bar = Foo() >>> cdef inline Foo fastbar = bar >>> >>> bar.method() # through vtab >>> fastbar.method() # direct call >> Why would you want to control this from user code? > > It's explicit and selectively breaks Python's semantics as needed > for optimization. Much nicer than implicit and global breakage.
You assume that inlining would break things. It can't, given the current type instantiation semantics. That's why I don't see a reason to let users ask for inlining when the compiler can do it automatically without any user interaction. Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
