• Robert Bradshaw's avatar
    Inline keyword for cdef functions, variable assignment on declaration (+optimization) · a72407b4
    Robert Bradshaw authored
    "cdef inline foo()" now valid, and will place inline in the resulting c code
    
    "cdef o = expr" and "cdef type x = expr" now valid.
    This may not seem like a huge change, but it ended up requiring
    quite a bit of work. The variables are still all declared at the
    top, but the assignment takes place at the specified line in the
    code.
    
    If an assignment is made at declaration, the variable is initalized to
    0 rather than None (also skipping an INCREF) and Py_XDECREF is used on
    exiting the function (in case an error occured before the actual value
    was calculated). Hence these variables MUST NOT be used before they are
    defined or it will probably segfault.
    a72407b4
Nodes.py 152 KB